Module:Color/doc: Difference between revisions
From Neodyland Wiki
More actions
mNo edit summary |
mNo edit summary |
||
| Line 1: | Line 1: | ||
{{Module rating|alpha<!-- beta • release • protected • semiprotected -->}} | {{Module rating|pre-alpha<!-- alpha • beta • release • protected • semiprotected -->}} | ||
This module is used primarily by {{tl|Infobox color}}, eliminating the need for external color converters and preventing mismatch between color coordinates. | This module is used primarily by {{tl|Infobox color}}, eliminating the need for external color converters and preventing mismatch between color coordinates. | ||
Revision as of 22:20, 10 January 2022
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 HSL or HSV:
{{#invoke:Color|hexToHsl|color|precision=?}}{{#invoke:Color|hexToHsv|color|precision=?}}
To convert a hexadecimal triplet to the perceptual CIELChuvuv color space:
{{#invoke:Color|hexToCielch|color|precision=?}}
The precision parameter is optional and defaults to zero.