• Home
  • Random
  • Recent changes
  • Special pages
  • Settings
  • About MOASSpedia
  • Disclaimers
MOASSpedia
  • 216.73.216.154
  • Talk
  • Watchlist
  • Contributions
  • Log in

Template:Value color

Template Discussion
  • Language
  • Watch
  • History
  • Edit
    • Page information
    • Permanent link
    • What links here
Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:Value color

This template returns the color for a given value in a range. It interpolates the colour between given min and max values and colors (if not specified, these are assumed to be white for the min and black for the max). It might be a good idea to use it with a template like {{Greater color contrast ratio}} to make sure the text is legible.

Usage

{{Value color|value|min|max|min color|max color}}

Parameters
  • |1= - The value of the cell (a number)
  • |2= - The minimum value of the range
  • |3= - The maximum value of the range
  • |4= - The color for the minimum value specified by |2=
  • |5= - The color for the maximum value specified by |3=

Example

<span style="color:{{Value color|50|25|100|FF0000|0000FF}}">Foo</span> --> Foo

See also

  • {{Cell color}}
The above documentation is transcluded from Template:Value color/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://moasspedia.org/w/index.php?title=Template:Value_color&oldid=38535"
Categories:
  • Lua-based templates
  • Color templates
Last edited on 8 January 2022, at 20:59

MOASSpedia

Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • This page was last edited on 8 January 2022, at 20:59.
  • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • Privacy policy
  • About MOASSpedia
  • Disclaimers
  • Desktop