(04-13-2023, 11:48 AM)dbox Wrote:Code: (Select All)Dim colors() As _Unsigned Long
colors("brick red") = &HFFC62D42
colors("electric lime") = &HFFCCFF00
colors("metalic sunburst") = &HFF9C7C38
Cls , 15
Line (10, 10)-(100, 100), colors("electric lime"), BF
Line (200, 200)-(300, 300), colors("brick red"), BF
Circle (200, 100), 50, colors("metalic sunburst")
This could be faked as function, and on 64-bit it's faster than any "dictionary" implementation:
Code: (Select All)
FUNCTION colors~& (mycolor$)
DIM iret AS _UNSIGNED LONG
IF mycolor$ = "brick red" THEN
iret = &HFFC62D42
ELSEIF mycolor$ = "electric lime" THEN
iret = &HFFCCFF00
ELSEIF mycolor$ = "metallic sunburst" THEN
iret = &HFF9C7C38
ELSE
iret = 0
END IF
colors~& = iret
END FUNCTION