# Color addon

## API: al_color_cmyk


## API: al_color_cmyk_to_rgb


## API: al_color_hsl


## API: al_color_hsl_to_rgb

Parameters:

* hue - Color hue angle in the range 0..360.
* saturation - Color saturation in the range 0..1.
* lightness - Color lightness in the range 0..1.
* red, green, blue - returned RGB values in the range 0..1.

## API: al_color_hsv


## API: al_color_hsv_to_rgb

Parameters:

* hue - Color hue angle in the range 0..360.
* saturation - Color saturation in the range 0..1.
* value - Color value in the range 0..1.
* red, green, blue - returned RGB values in the range 0..1.

## API: al_color_html

## API: al_color_html_to_rgb

## API: al_color_rgb_to_html

Parameters:

* red, green, blue - The color components in the range 0..1.
* string - A string with a size of 8 bytes into which the result will
be written.

Example:

    char html[8];
    al_color_rgb_to_html(1, 0, 0, html);

Now html will contain "#ff0000".

## API: al_color_name


## API: al_color_name_to_rgb

Parameters:

* name - The (lowercase) name of the color.
* r, g, b - If one of the recognized color names below is passed,
  the corresponding RGB values in the range 0..1 are written.

The recognized names are:

> aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque,
black, blanchedalmond, blue, blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson,
cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid,
darkred, darksalmon, darkseagreen, darkslateblue, darkslategray,
darkturquoise, darkviolet, deeppink, deepskyblue, dimgray,
dodgerblue, firebrick, floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, goldenrod, gold, gray, green, greenyellow, honeydew,
hotpink, indianred, indigo, ivory, khaki, lavenderblush, lavender,
lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgreen, lightgrey, lightpink,
lightsalmon, lightseagreen, lightskyblue, lightslategray,
lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon,
mediumaquamarine, mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise,
mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, 
avajowhite, navy, oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise, palevioletred,
papayawhip, peachpuff, peru, pink, plum, powderblue, purple,
purwablue, red, rosybrown, royalblue, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue,
slategray, snow, springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen

They are taken from <http://en.wikipedia.org/wiki/X11_color_names>,
with CSS names being preferred over X11 ones where there is overlap.

Returns:
0 if a name from the list above was passed, else 1.

## API: al_color_rgb_to_cmyk

Each RGB color can be represented in CMYK with a K component of 0
with the following formula:

    C = 1 - R
    M = 1 - G
    Y = 1 - B
    K = 0

This function will instead find the representation with the maximal
value for K and minimal color components.

## API: al_color_rgb_to_hsl

Given an RGB triplet with components in the range 0..1, return
the hue in degrees from 0..360 and saturation and lightness in the
range 0..1.

## API: al_color_rgb_to_hsv

Given an RGB triplet with components in the range 0..1, return
the hue in degrees from 0..360 and saturation and value in the
range 0..1.

## API: al_color_rgb_to_name

Given an RGB triplet with components in the range 0..1, find a color
name describing it approximately.

## API: al_color_rgb_to_yuv


## API: al_color_yuv


## API: al_color_yuv_to_rgb


