Documentation/Calc Functions/COLOR/en

Function name:
COLOR

Category:
Mathematical

Summary:
Combines specified values of the red, green, blue, and alpha channels of an RGBA color representation to produce a single encoded value.

Syntax:
COLOR(Red; Green; Blue[; Alpha])

Returns:
Returns an integer in the range [0, 232-1] that is the color value constructed from the specified components.

Arguments:
Red is an integer in the range [0, 255], or a reference to a cell containing that number, that is the intensity of the red color.

Green is an integer in the range [0, 255], or a reference to a cell containing that number, that is the intensity of the green color.

Blue is an integer in the range [0, 255], or a reference to a cell containing that number, that is the intensity of the blue color.

Alpha is an integer in the range [0, 255], or a reference to a cell containing that number, that is the value for the alpha channel. If omitted, a default value of 0 is applied. A value of 0 means that the color is fully transparent, whereas a value of 255 gives a fully opaque color.


 * If any argument is non-numeric, then COLOR reports a #VALUE! error.
 * If any argument is a non-integer value, then COLOR converts it to an integer by taking its floor value.
 * If any argument is less than 0 or greater than 255, then COLOR reports an invalid argument error (Err:502).

Additional details:

 * The value returned by COLOR has the alpha sample in its most significant 8 bits, followed by the red sample, green sample and finally the blue sample in the least significant 8 bits.

$$\text{COLOR}(red, green, blue, alpha)~=~256*256*256*alpha~+~ 256*256*red~+~256*green~+~blue$$
 * COLOR combines the samples using the following formula:


 * 232 is equal to 4294967296.

Related LibreOffice functions:
None

ODF standard:
None

Equivalent Excel functions:
None