Post by Admin on Jan 6, 2020 5:10:27 GMT
The program bellow uses 2 commands: PROCcolor and PROCresetrgb
* PROCcolor is behind most of the depth colors within RETROLIB 10
PROCcolor("f","color") for foreground standard or custom R,G,B colors
PROCcolor("b","color")-for background standard or custom R,G,B colors
Example of R,G,B color setting:
PROCcolor("f","050,100,250"):REM remember that each color in the must be 3 digits "RRR,GGG,BBB"
Example of 0-15 standard colors:
PROCcolor("f","7"): REM if you are only using 0-15 in the standard colors
Example of using words for color
PROCcolor("f","light yellow")
* PROCcolor is behind most of the depth colors within RETROLIB 10
PROCcolor("f","color") for foreground standard or custom R,G,B colors
PROCcolor("b","color")-for background standard or custom R,G,B colors
Example of R,G,B color setting:
PROCcolor("f","050,100,250"):REM remember that each color in the must be 3 digits "RRR,GGG,BBB"
Example of 0-15 standard colors:
PROCcolor("f","7"): REM if you are only using 0-15 in the standard colors
Example of using words for color
PROCcolor("f","light yellow")
MODE 8
REM lets set background color to green
PROCcolor("b","green")
CLG
REM now lets make the foreground color light blue
PROCcolor("f","light blue")
CIRCLE 500,500,100
REM and to make sure to reset the main colors to original settings:
PROCresetrgb
END
REM restore default color palettes
DEFPROCresetrgb
COLOUR 0,0,0,0 :COLOUR 1,200,0,0 :COLOUR 2,000,200,000
COLOUR 3,200,200,000:COLOUR 4,000,000,200:COLOUR 5,200,000,200
COLOUR 6,000,200,200:COLOUR 7,200,200,200:COLOUR 8,056,056,056
COLOUR 9,248,056,056:COLOUR 10,056,248,056:COLOUR 11,248,248,056
COLOUR 12,056,056,248:COLOUR 13,248,056,248:COLOUR 14,056,248,248
COLOUR 15,248,248,248
ENDPROC
DEF PROCcolor(fb$,rgb$)
PRIVATE assemble$,br%,bg%,bb%
IF rgb$="0" OR rgb$="black" THEN rgb$="000,000,000"
IF rgb$="1" OR rgb$="red" THEN rgb$="200,000,000"
IF rgb$="2" OR rgb$="green" THEN rgb$="000,200,000"
IF rgb$="3" OR rgb$="yellow" THEN rgb$="200,200,000"
IF rgb$="4" OR rgb$="blue" THEN rgb$="000,000,200"
IF rgb$="5" OR rgb$="magenta" THEN rgb$="200,000,200"
IF rgb$="6" OR rgb$="cyan" THEN rgb$="000,200,200"
IF rgb$="7" OR rgb$="white" THEN rgb$="200,200,200"
IF rgb$="8" OR rgb$="grey" THEN rgb$="056,056,056"
IF rgb$="9" OR rgb$="light red" THEN rgb$="248,056,056"
IF rgb$="10" OR rgb$="light green" THEN rgb$="056,248,056"
IF rgb$="11" OR rgb$="light yellow" THEN rgb$="248,248,056"
IF rgb$="12" OR rgb$="light blue" THEN rgb$="056,056,248"
IF rgb$="13" OR rgb$="light magenta" THEN rgb$="248,056,248"
IF rgb$="14" OR rgb$="light cyan" THEN rgb$="056,248,248"
IF rgb$="15" OR rgb$="light white" THEN rgb$="248,248,248"
assemble$=rgb$
br%=VAL(MID$(assemble$,1,3)):bg%=VAL(MID$(assemble$,5,3)):bb%=VAL(MID$(assemble$,9,3))
IF fb$="f" OR fb$="F" THEN COLOUR 0,br%,bg%,bb% : GCOL 0
IF fb$="b" OR fb$="B" THEN COLOUR 1,br%,bg%,bb% : GCOL 128+1
ENDPROC