Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Color/doc: Difference between revisions

From Neodyland Wiki
Added conversion to CMYK
Line 15: Line 15:
:<code><nowiki>{{</nowiki>#invoke:Color|''hexToHsv''<nowiki>|color|precision=?}}</nowiki></code>
:<code><nowiki>{{</nowiki>#invoke:Color|''hexToHsv''<nowiki>|color|precision=?}}</nowiki></code>


To convert a hexadecimal triplet to the perceptual [[CIELChuv|CIELChuv<sub>uv</sub>]] color space:
To convert a hexadecimal triplet to the perceptual [[CIELChuv|CIELCh<sub>uv</sub>]] color space:
:<code><nowiki>{{</nowiki>#invoke:Color|''hexToCielch''<nowiki>|color|precision=?}}</nowiki></code>
:<code><nowiki>{{</nowiki>#invoke:Color|''hexToCielch''<nowiki>|color|precision=?}}</nowiki></code>



Revision as of 01:04, 11 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 the CMYK color model without a color profile:

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

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 precision parameter is optional and defaults to zero.


Contents
Cookies help us deliver our services. By using our services, you agree to our use of cookies.