Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation
Components
gb
gb.args
gb.cairo
gb.chart
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.data
gb.db
gb.db.form
gb.db.mysql
gb.db.odbc
gb.db.postgresql
gb.db.sqlite2
gb.db.sqlite3
gb.dbus
gb.dbus.trayicon
gb.debug
gb.desktop
gb.desktop.gnome.keyring
gb.desktop.x11
gb.eval
gb.eval.highlight
gb.form
gb.form.dialog
gb.form.editor
gb.form.htmlview
gb.form.mdi
gb.form.print
gb.form.stock
gb.form.terminal
gb.gmp
gb.gsl
gb.gtk
gb.gtk.opengl
gb.gtk3
gb.gtk3.opengl
gb.gtk3.webview
gb.gui
gb.gui.opengl
gb.gui.qt
gb.gui.qt.ext
gb.gui.qt.opengl
gb.gui.qt.webkit
gb.gui.trayicon
gb.gui.webview
gb.hash
gb.highlight
gb.image
gb.image.effect
gb.image.imlib
gb.image.io
gb.inotify
gb.jit
gb.libxml
gb.logging
gb.map
gb.markdown
gb.media
gb.media.form
gb.memcached
gb.mime
gb.mysql
gb.ncurses
gb.net
gb.net.curl
gb.net.pop3
gb.net.smtp
gb.openal
gb.opengl
gb.opengl.glsl
gb.opengl.glu
gb.opengl.sge
gb.openssl
gb.option
gb.pcre
gb.pdf
gb.poppler
gb.qt4
.combobox.item
.container.children
.Menu.Children
.TabStripContainer
.TabStripContainer.Children
.TextArea.Selection
.TextBox.Selection
.Window.Controls
.Window.Menus
_ColumnView_Columns
_ComboBox_Item
_ComboBox_Selection
_Draw_Clip
_Draw_Style
_GridView_Cell
_GridView_Column
_GridView_Columns
_GridView_Data
_GridView_Row
_GridView_Rows
_Gui
_IconView_Item
_ListBox_Item
_split
_TreeView
_TreeView_Item
Action
Align
Animation
Application
Arrange
Border
Button
CheckBox
Clipboard
Color
Background
ButtonBackground
ButtonForeground
Foreground
LightBackground
LightForeground
LinkForeground
SelectedBackground
SelectedForeground
TextBackground
TextForeground
TooltipBackground
TooltipForeground
VisitedForeground
ColumnView
ComboBox
Container
ContainerChildren
Control
Cursor
Desktop
Dialog
Direction
Drag
Draw
DrawingArea
embedder
Fill
Font
Fonts
Form
Frame
GridView
HBox
HPanel
HSplit
IconView
Image
Key
Label
Line
ListBox
ListView
Menu
Message
Mouse
MovieBox
Paint
PaintBrush
PaintExtents
PaintMatrix
Panel
Picture
PictureBox
Point
Pointer
PointF
Printer
ProgressBar
RadioButton
Rect
RectF
Screen
Screens
Scroll
ScrollArea
ScrollBar
ScrollView
Select
Separator
Slider
SpinBox
Splitter
Spring
Style
SvgImage
TabStrip
TextArea
TextBox
TextLabel
ToggleButton
ToolButton
trayicon
trayicons
TreeView
UserContainer
UserControl
VBox
VPanel
VSplit
Watcher
Window
Windows
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt4.webview
gb.qt5
gb.qt5.ext
gb.qt5.opengl
gb.qt5.webkit
gb.qt5.webview
gb.qt6
gb.qt6.ext
gb.qt6.opengl
gb.qt6.webview
gb.report
gb.report2
gb.scanner
gb.sdl
gb.sdl.sound
gb.sdl2
gb.sdl2.audio
gb.settings
gb.signal
gb.term
gb.test
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.web.form
gb.web.gui
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
Controls pictures
Deprecated components
Developer Documentation
Development Environment Documentation
Documents
Error Messages
Gambas Playground
How To's
Language Index
Language Overviews
Last Changes
Lexicon
README
Search the wiki
To Do
Topics
Tutorials
Wiki License
Wiki Manual

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 can be used as a static function.

This class acts like a read-only static array.

Inherited constants
Black   Numeric value representing the black color.
Blue   Numeric value representing the blue color.
Cyan   Numeric value representing the cyan color.
DarkBlue   Numeric value representing the dark blue color.
DarkCyan   Numeric value representing the dark cyan color.
DarkGray   Numeric value representing the dark gray color.
DarkGreen   Numeric value representing the dark green color.
DarkMagenta   Numeric value representing the dark magenta color.
DarkOrange   Numeric value representing the dark orange color.
DarkPurple   Numeric value representing the dark purple color.
DarkRed   Numeric value representing the dark red color.
DarkRoyal   Numeric value representing the dark royal blue color.
DarkViolet   Numeric value representing the dark violet color.
DarkYellow   Numeric value representing the dark yellow color.
Default   Numeric value representing the "default color" of whatever it's applied to.
Gray   Numeric value representing the gray color.
Green   Numeric value representing the green color.
LightGray   Numeric value representing the light gray color.
Magenta   Numeric value representing the magenta color.
Orange   Numeric value representing the orange color.
Pink   Numeric value representing the pink color.
Purple   Numeric value representing the purple color.
Red   Numeric value representing the red color.
Royal   Numeric value representing the royal blue color.
SoftBlue   Numeric value representing a soft blue color.
SoftCyan   Numeric value representing a soft cyan color.
SoftGreen   Numeric value representing a soft green color.
SoftMagenta   Numeric value representing a soft magenta color.
SoftOrange   Numeric value representing a soft orange color.
SoftPurple   Numeric value representing a soft purple color.
SoftRed   Numeric value representing a soft red color.
SoftRoyal   Numeric value representing a soft royal blue color.
SoftViolet   Numeric value representing a soft violet color.
SoftYellow   Numeric value representing a soft yellow color.
Transparent   Numeric value indicating that the object is to be drawn transparently, if supported.
Violet   Numeric value representing the purple color.
White   Numeric value representing the white color.
Yellow   Numeric value representing the yellow color.

Static properties
Background   Returns the system default background color.
ButtonBackground   Returns the system default background color for buttons.
ButtonForeground   Returns the system default foreground color for buttons.
Foreground   Returns the system default foreground color.
LightBackground   Returns a lighter version of Color.SelectedBackground.
LightForeground   Return a lighter mix of the TextBackground and TextForeground color.
LinkForeground   Return the default foreground color of links.
SelectedBackground   Returns the system default background color for selected items.
SelectedForeground   Returns the system default foreground color for selected items.
TextBackground   Returns the system default background color for text.
TextForeground   Returns the system default foreground color for text.
TooltipBackground   Return the system background color used for displaying tooltips and Balloon messages.
TooltipForeground   Return the system foreground color used for displaying tooltips and Balloon messages.
VisitedForeground   Return the default foreground color of visited links.

Inherited static methods
Blend   Blends the Source color into the Destination color, according to the alpha channel of both colors, and returns the resulting color.
Darker   Returns a darker version of a color.
Desaturate   Return the specified color desaturated, i.e. grayed.
Distance   Return the RGB distance between two colors as a floating point number between 0.0 and 1.0.
GetAlpha   Return the alpha component of the specified color.
Gradient   Return a color that is the RGB mean between Color1 and Color2
HSV   Returns a color value from its hue, saturation, value and alpha components.
Invert   Invert a color and return it.
Lighter   Returns a lighter version of a color.
Merge   Returns a mix between Color1 and Color2.
RGB   Returns a color value from its red, green, blue and alpha components.
SetAlpha   Change the alpha component of a color and return it.
SetHSV   Set the HSVA components of the specified color and returns it as an integer value.
SetRGB   Set the RGBA components of the specified color and returns it as an integer value.
ToHTML   Return the HTML representation of the color.

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