' Rapid-Q by William Yu (c)1999-2000 . ' ================================================================================ ' Upload_il_tuo_script_su_Rapidq.it ' sb_color SB_COLOR is not a visible component. Basically it is a color structure which can prove to be very useful at color value conversions. the values are: RGB (including RGB Value) (Red, Green, Blue) CMYK (Cyan, Magenta, Yellow, Black) HLS (Hue, Lightness, Saturation) Hex Value All values are read / write Please Note the following: ... SUB ButtonClick DIM Col AS SB_COLOR Col.RGB = RGB(0,0,255) ... END SUB This WILL NOT work. You will not be able to retrieve values from the component at all, and RapidQ will not give any errors - be careful. Instead, do the following, creating the color in the main section of the program: DIM Col AS SB_COLOR ... SUB ButtonClick Col.RGB = RGB(0,0,255) ... END SUB Defined Colors: sbRED sbGREEN sbBLUE sbDARKRED sbDARKGREEN sbDARKBLUE sbMAGENTA sbYELLOW sbCYAN sbDARKMAGENTA sbDARKYELLOW sbDARKCYAN sbWHITE sbGRAY sbBLACK SB_COLOR Properties Field Type R/W Default Support =============== =============== =============== =============== =============== Red BYTE RW 0 W Red value of color. scale: 0 - 255 Green BYTE RW 0 W Blue BYTE RW 0 W Hex STRING RW "000000" W Hex value, in the format RRGGBB (RR = Red, GG = Green, BB = Blue) For all three values, their scale is 00 to FF (255 in decimal) When assigning the hex value, it does not matter if it begins with #, it will be removed anyway Value LONG RW 0 W RGB Value of the color. This is the same value you would get when using the built-in function RGB() You could therefore use RGB(R, G, B) to assign the color, or use one of the pre-defined colors (see Defined Colors above) Cyan BYTE RW 255 W Cyan value of color. scale: 0 - 255 Cyan, Magenta, Yellow and Black are mainly associated with printers. Magenta BYTE RW 255 W Yellow BYTE RW 255 W Black BYTE RW 255 W Hue INTEGER RW 360 W Hue value of color. scale: 0 - 360 Some paint programs use these values, e.g. Jasc Paint Shop Pro. The difference between PSP and this is that PSP uses a scale of 255 for all 3 Hue, Saturation and Lightness values. A simple alter of scale of paint shop pro values will get you the equivalent values used in this component. Lightness BYTE RW 0 W Lightness value of color. scale: 0 - 100 Adjusts how light the color is. 100 would be bright (white), whereas 0 would be dark (black) Saturation BYTE RW 0 W Saturation value of color. scale: 0 - 100 Adjusts how saturated the color is. 100 would make the color fully saturated, whereas 0 would have no saturation at all and would be a shade of gray SB_COLOR Methods Method Type Description Params Support =============== =============== =============== =============== =============== Convert current Websafe SUB color to 0 W websafe SB_COLOR Examples $INCLUDE "SBFunctions.inc" DIM FormColor AS SB_COLOR FormColor.Hex = "FF00FF" 'Red = 255, Green = 0, Blue = 255 CREATE Form AS QFORM Caption = "The colour of this form is Yellow" Center END CREATE Form.ShowModal ' =============================================================================== ' 2003 Holyguard.net - 2007_Abruzzoweb