ired -- The red color of the target widget. The range for each RGB component is 0-255
igreen -- The green color of the target widget. The range for each RGB component is 0-255
iblue -- The blue color of the target widget. The range for each RGB component is 0-255
ihandle -- an integer number (used as unique identifier) taken from the output of a previously located widget opcode (which corresponds to the target widget). It is used to unequivocally identify the widget when modifying its appearance with this class of opcodes. The user must not set the ihandle value directly, otherwise a Csound crash will occur.
Here is an example of the flsetcolor opcode. It uses the files flsetcolor.orc and flsetcolor.sco.
Example 1. Example of the flsetcolor opcode.
/* flsetcolor.orc */
; Using the opcode flsetcolor to change from the
; default colours for widgets
sr = 44100
kr = 441
ksmps = 100
nchnls = 1
FLpanel "Coloured Sliders", 900, 360, 50, 50
gkfreq, ihandle FLslider "A Red Slider", 200, 5000, -1, 5, -1, 750, 30, 85, 50
ired1 = 255
igreen1 = 0
iblue1 = 0
FLsetColor ired1, igreen1, iblue1, ihandle
gkfreq, ihandle FLslider "A Green Slider", 200, 5000, -1, 5, -1, 750, 30, 85, 150
ired1 = 0
igreen1 = 255
iblue1 = 0
FLsetColor ired1, igreen1, iblue1, ihandle
gkfreq, ihandle FLslider "A Blue Slider", 200, 5000, -1, 5, -1, 750, 30, 85, 250
ired1 = 0
igreen1 = 0
iblue1 = 255
FLsetColor ired1, igreen1, iblue1, ihandle
; End of panel contents
FLpanelEnd
; Run the widget thread!
FLrun
instr 1
endin
/* flsetcolor.orc */
/* flsetcolor.sco */
; 'Dummy' score event for 1 hour.
f 0 3600
e
/* flsetcolor.sco */
FLcolor, FLcolor2, FLhide, FLlabel, FLsetAlign, FLsetBox, FLsetColor2, FLsetFont, FLsetPosition, FLsetSize, FLsetText, FLsetTextColor, FLsetTextSize, FLsetTextType, FLsetVal_i, FLsetVal, FLshow