This has now been implemented for the next release.
Colour now has two new methods:
Colour.FromHex(hex As String) As Colour
Colour.ToHex() As String
The accepted hex formats are CSS-style strings:
Var red As Colour = Colour.FromHex("#FF0000")
Var redAlpha As Colour = Colour.FromHex("#FF000088")
#RRGGBB creates an opaque colour. #RRGGBBAA includes alpha, with the alpha value last. Hex digits are case-insensitive, so #ff0000 is also valid.
ToHex() returns uppercase text:
Print(Colour.Red.ToHex()) # #FF0000
Print(Colour.RGBA(255, 0, 0, 128).ToHex()) # #FF000080
I chose an explicit Colour.FromHex(...) method rather than allowing direct assignment from a String to a Colour, so ObjoBasic keeps its normal static type checking clear and predictable.
Thanks for the suggestion.