Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Template:Color temperature/doc

From Wikipedia, the free encyclopedia

{{Color temperature}} returns the color of a black body at a desired temperature. A polynomial approximation over reciprocal temperature is used. The exact formula is specified in Module:Color temperature.

Use

[edit]

Template expects a temperature greater than or equal to     800 K. Color is automatically labeled with the temperature unless the parameter text is filled. hexval tag can be used to return only an hexadecimal color code.

[edit]
  • Color space : sRGB
  • White point : D65
  • Gamma : 2.2

Warning

[edit]
  • Each color use the maximum peak luminance available on the screen because lightness variations of a black body are too high to be displayed on a regular display device.
  • Colors below     1,900 K are out of sRGB gamut. White had to be added (relative colorimetric mapping).
  •     800 K is the minimum value because it is the Draper point, where black-body radiation starts to become visible to the human eye.
  • The clause class="mw-no-invert" is necessary for use in tables in order to display correctly in dark mode.

Demo

[edit]

Display color temperature

[edit]

{{Color temperature|3400}} returns     3,400 K

Customize label

[edit]

{{Color temperature|1850|text=Candle light}} returns     Candle light

Return hexadecimal code

[edit]

{{Color temperature|6500|hexval}} returns fff8fe.

{{Color temperature|5000|xy}} returns 0.31350353, 0.32359593.

Feed a table

[edit]

<span class="mw-no-invert" style="background:#{{Color temperature|42000|hexval}}[...]

NAOS
Blue supergiant star
40,000 K - 44,000 K

Summary

[edit]

Display the color of a black body at a desired temperature

Template parameters

ParameterDescriptionTypeStatus
Temperature in kelvins1

Temperature of the black body, at least 800 K

Example
8907
Numberrequired
hexval2

hexval is an optional tag used to return only the hexadecimal value

Example
hexval
Stringoptional
xy3

xy is an optional tag used to return only the CIE xy coordinates

Example
xy
Stringoptional
Labeltext

Text displayed next to the color

Default
Temperature in kelvins
Example
text=Candle
Stringoptional

Color accuracy

[edit]

The template returns almost exactly the colors of the gradient below. More information on image description.