Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation from source code
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.db2
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
Color
_call
_get
Black
Blend
Blue
Cyan
DarkBlue
DarkCyan
Darker
DarkGray
DarkGreen
DarkMagenta
DarkOrange
DarkPurple
DarkRed
DarkRoyal
DarkViolet
DarkYellow
Default
Desaturate
Distance
GetAlpha
Gradient
Gray
Green
HSV
Invert
Lighter
LightGray
Magenta
Merge
Orange
Pink
Purple
Red
RGB
Royal
SetAlpha
SetHSV
SetRGB
SoftBlue
SoftCyan
SoftGreen
SoftMagenta
SoftOrange
SoftPurple
SoftRed
SoftRoyal
SoftViolet
SoftYellow
ToHTML
Transparent
Violet
White
Yellow
ColorInfo
Image
ImageStat
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.mongodb
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
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.image)

This static class defines predefined color constants, and some useful other methods to deal with colors.

This class is static.

This class can be used as a static function.

This class acts like a read-only static array.

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 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