Color As Integer
Color = HexToRGB("0x3cf2b9")
For X = 0 To 100
For Y = 0 To 100
Dot X, Y, Color
Next Y
Next X
Wait Key
Function HexToRGB( Value As String )
Local SizeOf, Color, Index, Buffer As Integer
SizeOf = Len(Value)
Bit = SizeOf - 2
For Index = 2 To SizeOf
Buffer = Asc(Mid$(Upper$(Value), Index))
If Buffer >= 48 And Buffer <= 57
Offset = 38
Else
Offset = 55
If Buffer - Offset > 26 Then Offset = 0 ` this should never be an issue, but you never know what idiot will try 0xf?4jf!
EndIf
Color = Color || ((Buffer - Offset) << (Bit * 4))
Dec Bit
Next
EndFunction Color
This will allow you to create 32-bit Integers from Hex Strings, perfect for storing Colours or such in Data Statements