Module:Color/doc explained

This module is used primarily by, eliminating the need for external color converters and preventing mismatch between color coordinates.

Usage

To use this module, you may use one of the above listed templates or invoke the module directly. All functions that accept hexadecimal triplets also handle the shorthand three-digit format.

To convert a hexadecimal triplet to an RGB triplet as comma-separated values:

<nowiki>{{</nowiki>#invoke:Color|''hexToRgbTriplet''<nowiki>|color}}</nowiki>

To convert a hexadecimal triplet to the CMYK color model without a color profile (which is a very bad idea!):

<nowiki>{{</nowiki>#invoke:Color|''hexToCmyk''<nowiki>|color|precision=?|pctsign=?}}</nowiki>

To convert a hexadecimal triplet to HSL or HSV:

<nowiki>{{</nowiki>#invoke:Color|''hexToHsl''<nowiki>|color|precision=?}}</nowiki>

<nowiki>{{</nowiki>#invoke:Color|''hexToHsv''<nowiki>|color|precision=?}}</nowiki>

To convert a hexadecimal triplet to the perceptual CIELChuv color space:

<nowiki>{{</nowiki>#invoke:Color|''hexToCielch''<nowiki>|color|precision=?}}</nowiki>

To mix two colors in the more physically correct linear RGB space:

<nowiki>{{</nowiki>#invoke:Color|''hexMix''<nowiki>|color1|color2|proportion|min=?|max=?}}</nowiki>

To convert an RGB triplet to a hex code:

<nowiki>{{</nowiki>#invoke:Color|''rgbTripletToHex''<nowiki>|r|g|b}}</nowiki>

The following parameters are optional: