• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:RGB

  • Template
  • Talk
  • Language
  • Watch
  • View source
Template documentation[view] [edit] [history] [purge]

Usage

Converts three 8-bit numbers or three percentages to a "rgb(r,g,b)" value, usable in CSS color properties. This template can be substituted.

Useful for all sorts of color-related nefarious purposes.

Input
  • three parameters, each numeric in the range 0..255 (larger numbers will wrap around)
Output
  • a triplet of two-digit hex numbers

Examples

  • {{RGB|0|0|0}} gives rgb(0,0,0)
  • {{subst:RGB|0|0|0}} gives rgb(0,0,0)
  • {{RGB|123|45|67|}} gives rgb(123,45,67)
  • {{subst:RGB|123|45|67}} gives rgb(123,45,67)
  • {{RGB|255|255|255}} gives rgb(255,255,255)
  • {{subst:RGB|255|255|255}} gives rgb(255,255,255)
  • {{RGB|0%|0%|0%}} gives rgb(0%,0%,0%)
  • {{RGB|123%|45%|67%|}} gives rgb(123%,45%,67%)
  • {{RGB|100%|100%|100%}} gives rgb(100%,100%,100%)

See also

  • {{Hex3}} for formating as a "#RRGGBB" hex value
  • {{Lighten}}
The above documentation is transcluded from Template:RGB/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:RGB&oldid=1177209565"
Last edited on 26 September 2023, at 18:00

Languages

    • Asturianu
    • Español
    • Galego
    • 한국어
    • മലയാളം
    • Português
    • Simple English
    • Татарча / tatarça
    • တႆး
    • اردو
    • Tiếng Việt
    • 中文
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 26 September 2023, at 18:00 (UTC).
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop