Template:Color temperature
{{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
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.
Recommended display
- Color space : sRGB
- White point : D65
- Gamma : 2.2
Warning
- 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
Display color temperature
{{Color temperature|3400}} returns 3,400 K
Customize label
{{Color temperature|1850|text=Candle light}} returns Candle light
Return hexadecimal code
{{Color temperature|6500|hexval}} returns fff8fe.
Return CIE xy coordinates
{{Color temperature|5000|xy}} returns 0.31350353, 0.32359593.
Feed a table
<span class="mw-no-invert" style="background:#{{Color temperature|42000|hexval}}[...]
NAOS
Blue supergiant star
40,000 K - 44,000 K
Summary
Display the color of a black body at a desired temperature
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Temperature in kelvins | 1 | Temperature of the black body, at least 800 K
| Number | required |
| hexval | 2 | hexval is an optional tag used to return only the hexadecimal value
| String | optional |
| xy | 3 | xy is an optional tag used to return only the CIE xy coordinates
| String | optional |
| Label | text | Text displayed next to the color
| String | optional |
Color accuracy
The template returns almost exactly the colors of the gradient below. More information on image description.

Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.