These functions can be used in expressions associated with setting and evaluating the color properties of chart objects, as well as in data load scripts.
Information noteQlik Sense supports the color functions qliktechblue and qliktechgray for backwards compatibility reasons, but use of them is not recommended.
Use the drop-down on each function to see a brief description and the syntax of each function. Click the function name in the syntax description for further details.
ARGB() is used in expressions to set or evaluate the color properties of a chart object, where the color is defined by a red component r, a green
component g, and a blue component
b, with an alpha factor (opacity)
of alpha.
HSL() is used in expressions to set or evaluate the color properties of a chart object, where the color is defined by
values of hue, saturation, and luminosity between 0
and 1.
RGB() returns an integer corresponding to the color code of the color defined by the three parameters: the red component r, the green component g, and the blue component b. These components must have integer values between 0 and 255. The function can be used in expressions to set or evaluate the color properties of a chart object.
Color() is used in expressions to return the color representation of color number n in the chart palette shown in the chart properties. The color representation is a dual value where the text representation comes in the form of 'RGB(r, g, b)' where r, g and b are numbers between 0 and 255 representing the red, green and blue color value respectively. The number representation is an integer representing the red, green and blue components.
Color (n)
Colormix1() is used in expressions to return an ARGB color representation from a two color gradient, based on a value between 0 and 1.
Colormix1 (Value , ColorZero , ColorOne)
Value is a real number between 0 and 1.
If Value = 0 ColorZero is returned.
If Value = 1 ColorOne is returned.
If 0 < Value< 1 the appropriate intermediate shading is returned.
ColorZero is a valid RGB color representation for the color to be associated with the low end of the interval.
ColorOne is a valid RGB color representation for the color to be associated with the high end of the interval.
Example:
Colormix1(0.5, red(), blue())
returns:
ARGB(255,64,0,64) (purple)
Colormix2() is used in expressions to return an ARGB color representation from a two color gradient, based on a value between -1 and 1, with the possibility to specify an intermediate color for the center (0) position.
If -1 < Value< 1 the appropriate color mix is returned.
ColorMinusOne is a valid RGB color representation for the color to be associated with the low end of the interval.
ColorOne is a valid RGB color representation for the color to be associated with the high end of the interval.
ColorZero is an optional valid RGB color representation for the color to be associated with the center of the interval.
SysColor() returns the ARGB color representation for the Windows system color nr, where nr corresponds to the parameter to the Windows API function GetSysColor(nr).
SysColor (nr)
ColorMapHue() returns an ARGB value of a color from a colormap that varies the hue component of the HSV color model. The colormap starts with red, passes through yellow, green, cyan, blue, magenta, and returns to red. x must be specified as a value between 0 and 1.
ColorMapHue (x)
ColorMapJet() returns an ARGB value of a color from a colormap that starts with blue, passes through cyan, yellow and orange, and returns to red. x must be specified as a value between 0 and 1.
ColorMapJet (x)
Pre-defined color functions
The following functions can be used in expressions for pre-defined colors. Each function returns an RGB color representation.
Optionally a parameter for alpha factor can be given, in which case an ARGB color representation is returned. An alpha factor of 0 corresponds to full transparency, and an alpha factor of 255 corresponds to full opacity. If a value for alpha is not entered, it is assumed to be 255.
Pre-defined color functions
Color function
RGB value
black ([alpha])
(0,0,0)
blue([alpha])
(0,0,128)
brown([alpha])
(128,128,0)
cyan([alpha])
(0,128,128)
darkgray([alpha])
(128,128,128)
green([alpha])
(0,128,0)
lightblue([alpha])
(0,0,255)
lightcyan([alpha])
(0,255,255)
lightgray([alpha])
(192,192,192)
lightgreen([alpha])
(0,255,0)
lightmagenta([alpha])
(255,0,255)
lightred([alpha])
(255,0,0)
magenta([alpha])
(128,0,128)
red([alpha])
(128,0,0)
white([alpha])
(255,255,255)
yellow([alpha])
(255,255,0)
Examples and results:
Examples and results
Examples
Results
Blue()
RGB(0,0,128)
Blue(128)
ARGB(128,0,0,128)
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!