Jump to content

Module:Color/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ftrebien (talk | contribs) at 14:05, 11 January 2022 (Alpha, worked in hundreds of cases tested so far). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

This module is used primarily by {{Infobox color}}, 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:

{{#invoke:Color|hexToRgbTriplet|color}}

To convert a hexadecimal triplet to the CMYK color model without a color profile:

{{#invoke:Color|hexToCmyk|color|precision=?|pctsign=?}}

To convert a hexadecimal triplet to HSL or HSV:

{{#invoke:Color|hexToHsl|color|precision=?}}
{{#invoke:Color|hexToHsv|color|precision=?}}

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

{{#invoke:Color|hexToCielch|color|precision=?}}

The following parameters are optional:

  • precision: defaults to zero
  • pctsign: set to 0 (zero) to suppress percent signs in the generated output