comp • gb.qt4 • color

Color (gb.qt4)

This static class has properties that return system colors. Look at Color of gb.image for color constants and useful methods.

In Gambas, the alpha color component is inverted in comparison to standard color coding.

In other words, an alpha component of zero is fully opaque, and an alpha component of 255 is fully transparent.

This class reimplements Color in gb.image.
This class is static.
This class acts like a
Splits a color into its components, and returns them as a colorinfo object.
read-only
static array.

Static properties

Static methods Constants
Returns the system default background color.
Background  
Returns the system default background color for buttons.
ButtonBackground  
Returns the system default foreground color for buttons.
ButtonForeground  
Returns the system default foreground color.
Foreground  
Returns a lighter version of Color.SelectedBackground.
LightBackground  
Return a lighter mix of the TextBackground and TextForeground color.
LightForeground  
Return the default foreground color of links.
LinkForeground  
Returns the system default background color for selected items.
SelectedBackground  
Returns the system default foreground color for selected items.
SelectedForeground  
Returns the system default background color for text.
TextBackground  
Returns the system default foreground color for text.
TextForeground  
Return the system background color used for displaying tooltips.
TooltipBackground  
Return the system foreground color used for displaying tooltips.
TooltipForeground  
Return the default foreground color of visited links.
VisitedForeground  
Blends the Source color into the Destination color, according to the alpha channel of both colors, and returns the resulting color.
Blend  
Returns a darker version of a color.
Darker  
Return the specified color desaturated, i.e. grayed.
Desaturate  
Return the RGB distance between two colors as a floating point number between 0.0 and 1.0.
Distance  
Return the alpha component of the specified color.
GetAlpha  
Return a color that is the RGB mean between Color1 and Color2
Gradient  
Returns a color value from its hue, saturation, value and alpha components.
HSV  
Returns a lighter version of a color.
Lighter  
Returns a mix between Color1 and Color2.
Merge  
Returns a color value from its red, green, blue and alpha components.
RGB  
Change the alpha component of a color and return it.
SetAlpha  
Set the HSVA components of the specified color and returns it as an integer value.
SetHSV  
Set the RGBA components of the specified color and returns it as an integer value.
SetRGB  
Numeric value representing the black color.
Black  
Numeric value representing the blue color.
Blue  
Numeric value representing the cyan color.
Cyan  
Numeric value representing the dark blue color.
DarkBlue  
Numeric value representing the dark cyan color.
DarkCyan  
Numeric value representing the dark gray color.
DarkGray  
Numeric value representing the dark green color.
DarkGreen  
Numeric value representing the dark magenta color.
DarkMagenta  
Numeric value representing the dark red color.
DarkRed  
Numeric value representing the dark yellow color.
DarkYellow  
Numeric value representing the "default color" of whatever it's applied to.
Default  
Numeric value representing the gray color.
Gray  
Numeric value representing the green color.
Green  
Numeric value representing the light gray color.
LightGray  
Numeric value representing the magenta color.
Magenta  
Numeric value representing the orange color.
Orange  
Numeric value representing the pink color.
Pink  
Numeric value representing the red color.
Red  
Numeric value indicating that the object is to be drawn transparently, if supported.
Transparent  
Numeric value representing the purple color.
Violet  
Numeric value representing the white color.
White  
Numeric value representing the yellow color.
Yellow  

Examples

' this example uses 'color from gb.qt4'
Label1.Background = Color.LightForeground
Label1.Foreground = Color.VisitedForeground

' this example uses 'color from gb.image'
TextBox2.Background = Color.Yellow
TextBox2.Foreground = Color.Black

See also