Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Color/doc
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Module rating|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. == Usage == To use this module, you may use one of the above listed templates or invoke the module directly. All functions that accept [[Hex triplet|hexadecimal triplets]] also handle the shorthand three-digit format. To convert a hexadecimal triplet to an RGB triplet as comma-separated values: :<code><nowiki>{{</nowiki>#invoke:Color|''hexToRgbTriplet''<nowiki>|color}}</nowiki></code> To convert a hexadecimal triplet to the [[CMYK color model]] without a color profile: :<code><nowiki>{{</nowiki>#invoke:Color|''hexToCmyk''<nowiki>|color|precision=?|pctsign=?}}</nowiki></code> To convert a hexadecimal triplet to [[HSL and HSV|HSL or HSV]]: :<code><nowiki>{{</nowiki>#invoke:Color|''hexToHsl''<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|CIELCh<sub>uv</sub>]] color space: :<code><nowiki>{{</nowiki>#invoke:Color|''hexToCielch''<nowiki>|color|precision=?}}</nowiki></code> To mix two colors in the more physically correct linear RGB space: :<code><nowiki>{{</nowiki>#invoke:Color|''hexMix''<nowiki>|color1|color2|proportion|min=?|max=?}}</nowiki></code> To convert an RGB triplet to a hex code: :<code><nowiki>{{</nowiki>#invoke:Color|''rgbTripletToHex''<nowiki>|r|g|b}}</nowiki></code> The following parameters are optional: * <code>precision</code>: defaults to <code>0</code> (zero) * <code>pctsign</code>: set to <code>0</code> (zero) to suppress percent signs in the generated output * <code>proportion</code>: proportion of <code>color2</code>, defaults to 50 * <code>min</code>: minimum value of proportion range, defaults to 0 * <code>max</code>: maximum value of proportion range, defaults to 100 <includeonly>{{Sandbox other|| [[Category:Modules handling colors]] }}</includeonly>
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Module rating
(
edit
)
Template:Tl
(
edit
)