::pix::colorTop, Main, Index
- The following color formats can be used:
| Formats | Color |
|---|---|
| e.g : rgba(r,g,b,a) This format takes four arguments: red, green, and blue as integers between 0 and 255, and alpha as a floating-point number between 0.0 and 1.0. | |
| e.g : #F8D1DD This format takes a single string argument representing a hexadecimal color code. The hex code must be 7 characters long (including the '#' symbol), and each subsequent character must be a valid hexadecimal digit. | |
| e.g : rgb(r,g,b) This format takes three arguments for the red, green, and blue components of the color. All arguments are integer numbers between 0 and 255. | |
| e.g : FF0000FF A string of 8 hexadecimal characters (case-insensitive), typically representing an RGBA color format. | |
| e.g : FF0000 A string of 6 hexadecimal characters (case-insensitive), typically representing an RGB color format. | |
| e.g : rgbx(r,g,b,x) This format takes four arguments: red, green, blue, and alpha components. Unlike standard rgba, all four arguments in this format are integers between 0 and 255. | |
| e.g : {0.0 0.0 0.0 0.0} or {0.0 0.0 0.0} This format takes a Tcl list of three or four floating-point numbers between 0.0 and 1.0, representing the red, green, blue, and optional alpha components. | |
| e.g : white A standard HTML or CSS color specified by its name. | |
| e.g : hsv(h,s,v) This format takes three floating-point arguments for hue (0 to 360), saturation (0 to 100), and value (0 to 100) components. | |
| e.g : hsl(h,s,l) This format takes three floating-point arguments for hue (0 to 360), saturation (0 to 100), and lightness (0 to 100) components. | |
| e.g : #FF6 A shorthand hexadecimal notation of 4 characters (including the '#' symbol), where each color digit is automatically doubled (e.g., #RGB expands to #RRGGBB). |
CommandsTop, Main, Index
almostEqual [::pix::color]Top, Main, Index
Almost equal colors.
Parameters
color1 | A color string. |
color2 | A color string. |
epsilon | Double value Optional, default 0.01. |
Return value
True if colors are close.
darken [::pix::color]Top, Main, Index
Darkens the color by amount 0-1.
Parameters
color | A color string. |
amount | Double value (0-1) |
Return value
A string representation of the color.
desaturate [::pix::color]Top, Main, Index
Desaturate (makes grayer) the color by amount 0-1.
Parameters
color | A color string. |
amount | Double value (0-1) |
Return value
A string representation of the color.
distance [::pix::color]Top, Main, Index
A distance function based on CIEDE2000 color difference formula.
Parameters
color1 | A color string. |
color2 | A color string. |
Return value
A distance.
hexHTML [::pix::color]Top, Main, Index
Creates and returns a new hex HTML color object.
Parameters
hex | Hexadecimal color string (e.g., "#xxxxxx"). |
Return value
A string representation of the color.
hsl [::pix::color]Top, Main, Index
Sets a new hsl color object.
Parameters
h | hue (0-360) |
s | saturation (0-100) |
l | lightness (0-100) |
Return value
A string representation of the color.
lighten [::pix::color]Top, Main, Index
Lightens the color by amount 0-1.
Parameters
color | A color string. |
amount | Double value (0-1) |
Return value
A string representation of the color.
mix [::pix::color]Top, Main, Index
Mixes two colours using simple averaging or simple lerp if the 'lerp' argument is specified.
Parameters
color1 | A color string. |
color2 | A color string. |
lerp | Double value Optional, default "". |
Return value
A string representation of the color.
name [::pix::color]Top, Main, Index
Sets a new name color object.
Parameters
name | HTML name |
Return value
A string representation of the color.
rgb [::pix::color]Top, Main, Index
Creates and returns a new RGB color object (alpha defaults to 1.0).
Parameters
r | Integer value (0 to 255) |
g | Integer value (0 to 255) |
b | Integer value (0 to 255) |
Return value
A string representation of the color.
rgba [::pix::color]Top, Main, Index
Creates and returns a new RGBA color object.
Parameters
r | Integer value (0 to 255) |
g | Integer value (0 to 255) |
b | Integer value (0 to 255) |
a | Double value (0.0 to 1.0) |
Return value
A string representation of the color.
saturate [::pix::color]Top, Main, Index
Saturates (makes brighter) the color by amount 0-1.
Parameters
color | A color string. |
amount | Double value (0-1) |
Return value
A string representation of the color.
spin [::pix::color]Top, Main, Index
Rotates the hue of the color by degrees (0-360).
Parameters
color | A color string. |
degrees | Double value (0-360) |
Return value
Returns: A string representation of the color.