|
Post by Admin on Nov 25, 2019 5:25:17 GMT
I decided to make a generic color bar for programs that may want to select colors.
Basically its purpose is to allow 16 colors to be displayed at any location on a screen and also allow you to show a marker for the current color you are using. Handy dandy !!
The code bellow shows a demo of a color bar that has a marker that moves to the left a couple times to show its function.
This program TOOL is OPEN SOURCE. It is free to use in any person's project. This code I have offered to the world to help others be more productive, including myself.
MODE 8 REM colorbar(x,y,color) PROCcolorbar(0,900,14):REM creates the standard 16 colors and a selector WAIT 100 PROCcolorbar(0,900,12):REM move it to a diffrent spot (notice the line moves?) WAIT 100 PROCcolorbar(0,900,2):REM move again for another demo END REM all from scratch 0-15
DEF PROCcolorbar(locx%,locy%,sel%) LOCAL c%,l% FOR l%=0 TO 640 STEP 40 GCOL c% RECTANGLE FILL locx%+l%,locy%,40 c%+=1 NEXT l% GCOL 0 LINE locx%,locy%-7,locx%+640,locy%-7 LINE locx%,locy%-9,locx%+640,locy%-9 LINE locx%,locy%-11,locx%+640,locy%-11 GCOL 15:sel%=sel%*40 LINE locx%,locy%,locx%,locy%+42 LINE locx%,locy%+44,locx%+640,locy%+44 LINE locx%,locy%-3,locx%+640,locy%-3 LINE locx%+sel%,locy%-7,locx%+sel%+40,locy%-7 LINE locx%+sel%,locy%-9,locx%+sel%+40,locy%-9 LINE locx%+sel%,locy%-11,locx%+sel%+40,locy%-11 ENDPROC
|
|