pix 0.9: Reference Manual

::pix::colorTop, Main, Index

Formats Color
rgbae.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.
hexHtmle.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.
rgbe.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.
hexalphae.g : FF0000FF
A string of 8 hexadecimal characters (case-insensitive), typically representing an RGBA color format.
hexe.g : FF0000
A string of 6 hexadecimal characters (case-insensitive), typically representing an RGB color format.
rgbxe.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.
simple colore.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.
string colore.g : white
A standard HTML or CSS color specified by its name.
hsve.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.
hsle.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.
tiny hexe.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.

almostEqual color1 color2 ?epsilon?
Parameters
color1A color string.
color2A color string.
epsilonDouble 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.

darken color amount
Parameters
colorA color string.
amountDouble 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.

desaturate color amount
Parameters
colorA color string.
amountDouble 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.

distance color1 color2
Parameters
color1A color string.
color2A color string.
Return value

A distance.

hexHTML [::pix::color]Top, Main, Index

Creates and returns a new hex HTML color object.

hexHTML hex
Parameters
hexHexadecimal 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.

hsl h s l
Parameters
hhue (0-360)
ssaturation (0-100)
llightness (0-100)
Return value

A string representation of the color.

lighten [::pix::color]Top, Main, Index

Lightens the color by amount 0-1.

lighten color amount
Parameters
colorA color string.
amountDouble 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.

mix color1 color2 ?lerp?
Parameters
color1A color string.
color2A color string.
lerpDouble value Optional, default "".
Return value

A string representation of the color.

name [::pix::color]Top, Main, Index

Sets a new name color object.

name name
Parameters
nameHTML 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).

rgb r g b
Parameters
rInteger value (0 to 255)
gInteger value (0 to 255)
bInteger 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.

rgba r g b a
Parameters
rInteger value (0 to 255)
gInteger value (0 to 255)
bInteger value (0 to 255)
aDouble 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.

saturate color amount
Parameters
colorA color string.
amountDouble 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).

spin color degrees
Parameters
colorA color string.
degreesDouble value (0-360)
Return value

Returns: A string representation of the color.