; ColorRed Example ; ---------------- Graphics 640,480,0,2 SetBuffer BackBuffer() angle#=0 While Not KeyDown(1) Cls ; Smoothly cycle the drawing colour through a rainbow angle=angle+1 Color 128+Sin(angle)*127,128+Sin(angle+120)*127,128+Sin(angle+240)*127 ; Draw a swatch in the current drawing colour Rect 220,120,200,200,1 ; ColorRed reads back the red part of the current drawing colour r=ColorRed() ; Bar showing just the red component Color 255,0,0 Rect 20,420,r,20,1 Rect 20,420,256,20,0 Color 255,255,255 Text 0,0,"Esc: exit" Text 0,20,"ColorRed() = "+r Flip Wend End