Jump to content

Template:RGBparse/doc

From Wikipedia, the free encyclopedia

Uses one color out of the RGB triplet, and presents that as hex or decimal value.

Used: preprocessing input for {{RGBtoHSL.H}} etc.

Usage

[edit]
{{RGBparse
| rgb = (triplet format: #12cdef)
| c = R (or G or B)
| number = (hex or dec)
}}

Returns the value of one color

  • {{RGBparse|rgb=#1A2B3C|c=R|number=dec}} → 26
  • {{RGBparse|rgb=#1A2B3C|c=G|number=hex}} → 2B


Limits:

  • Does not check validity of RGB input
  • Does not handle RGB short triplet #ADE form