Some abstract. As an example we extract
interface documention from the color library.
1 Primary color encoding function. |
The function in this section, rgb-color-encoding, accepts a variety of different color formats as input.
It returns a string of length seven, such as "#ff00ff". The output format is the primary color representation in most web contexts. |
|
rgb-color-encoding |
Form | (rgb-color-encoding . color-pars) |
Description | Return a color encoding (a string of length seven such as "#123456") of color-pars.
The color-pars parameter(s) to this function are very versatile.
If it is a color encoding string already, just return it.
If it is a color value which satisfies the predicate rgb-color?, return the encoding of this value.
If it is a symbol, return the color encoding bound to it.
If it is a string, transform it to a symbol and return the color encoding bound to it.
If it is a list like (list 1 2 3), consider it as a red-green-blue list, and return the color encoding of it.
If it is three individiual parameters, say r, g, and b, return the color encoding of red r, green g, and blue b.
If you care about efficiency, use can consider to use the function rgb-string instead of rgb-color-encoding. |
Returns | A string of length 7 of the format "#rrggbb". |
Example | (rgb-color-encoding "red") |
Example | (rgb-color-encoding 255 0 0) |
Example | (rgb-color-encoding (make-rgb-color 255 0 0)) |
Example | (rgb-color-encoding '(255 0 0)) |
Example | (rgb-color-encoding (make-color 255 0 0)) |
Example | (rgb-color-encoding "#ff0000") |
Example | (rgb-color-encoding 'red) |
See also | more efficient functions | rgb-color rgb-color-list |
|
2 Secondary color encoding functions. |
The functions in this section only work with the old version of the color representation.
This is the untagged list representation, such as '(255 0 0).
For new development, the function
make-rgb-color should be used together with the color encoding function rgb-color-encoding.
|
|
rgb-color |
Form | (rgb-color r g b) |
Description | Return an 'Internet color string" encoding the colors r, g, and b. |
Parameters | r | The amount of red - a decimal number between 0 and 255. |
g | The amount of green - a decimal number between 0 and 255. |
b | The amount of blue - a decimal number between 0 and 255. |
Returns | A string of length 7 of the form "#rrggbb". |
|
rgb-color-list |
Form | (rgb-color-list color-triple-list) |
Description | Returns the color encoding of (list r g b) given a list of three color numbers as parameter. |
Parameters | color-triple-list | A list of length 3. Each element of the list is a decimal integer between 0 and 255. |
Returns | A string of length 7 of the form "#rrggbb". |
|
3 Color constructor, predicate, and selectors. |
The function make-rgb-color is the primary color constructor in LAML-based software.
The predidate and the selectors only work with make-rgb-color.
The function make-color is an old version of the constructor.
|
|
make-rgb-color |
Form | (make-rgb-color r g b) |
Description | Make and return a color represented by a red, green and blue constituent.
This is the primary color constructor of LAML-based software. |
Parameters | r | The amount of red - a decimal number between 0 and 255. |
g | The amount of green - a decimal number between 0 and 255. |
b | The amount of blue - a decimal number between 0 and 255. |
Returns | A tagged list of color numbers. |
Example | (rgb-color-encoding (make-rgb-color 255 0 0)) => "#ff0000" |
Example | (make-rgb-color 255 0 0) => (rgb-color 255 0 0) |
See also | conversion function | rgb-color-encoding |
|
rgb-color? |
Form | (rgb-color? x) |
Description | Is x a LAML color
|
|
red-of-rgb-color |
Form | (red-of-rgb-color color) |
Description | Return the red constituent of the LAML color. |
Parameters | color | A color constructed with make-rgb-color. |
See also | color constructor | make-rgb-color |
|
green-of-rgb-color |
Form | (green-of-rgb-color color) |
Description | Return the green constituent of the color. |
Parameters | color | A color constructed with make-rgb-color. |
See also | color constructor | make-rgb-color |
|
blue-of-rgb-color |
Form | (blue-of-rgb-color color) |
Description | Return the blue constituent of the color. |
Parameters | color | A color constructed with make-rgb-color. |
See also | color constructor | make-rgb-color |
|
make-color |
Form | (make-color r g b) |
Description | Make and return the rgb-list representation of the color with r red, g green, and b blue.
This is an old version of the color contructor. |
Note | Deprecated. Use make-rgb-color. |
|
4 Color constants. |
To stay backward compatible with a substantial amount of older LAML software, all color constants
are bound to the old LAML color representation. Thus, for instance, the value of red is (255 0 0), and not
(rgb-color 255 0 0). As an important observation, the primary color encoding function, rgb-color-encoding, accepts
the value of the color constants as input (besides a number of other kinds of input).
|
|
red |
Form | red |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
dark-red |
Form | dark-red |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
green |
Form | green |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
green1 |
Form | green1 |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
green2 |
Form | green2 |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
blue |
Form | blue |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
white |
Form | white |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
black |
Form | black |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
yellow |
Form | yellow |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
purple |
Form | purple |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
light-blue |
Form | light-blue |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
blue1 |
Form | blue1 |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
blue2 |
Form | blue2 |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
blue3 |
Form | blue3 |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
orange |
Form | orange |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
dark-yellow |
Form | dark-yellow |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
grey1 |
Form | grey1 |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
grey2 |
Form | grey2 |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
brown |
Form | brown |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
maroon |
Form | maroon |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
grey |
Form | grey |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
silver |
Form | silver |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
tetal |
Form | tetal |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
aqua |
Form | aqua |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
A color constant. A color is represented as a list of integers of length three (rgb).
|
|
lime |
Form | lime |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
A color constant. A color is represented as a list of integers of length three (rgb).
|
|
olive |
Form | olive |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
navy |
Form | navy |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|
fuchsia |
Form | fuchsia |
Description | A color constant. A color is represented as a list of integers of length three (rgb).
|
|