Getting Color Right

The Chromaticity Of White Light

When shopping for lamps, you’re often given choices for their color temperature, which can be described as warm white, cool white, or daylight. Alternatively, you might come across color temperature values like 2700K or 5000K.

But here’s the thing: our eyes have a nifty feature called “color constancy” that makes us overlook the color of light. For instance, a glass of wine will look red, whether outside during a sunny barbecue or enjoying a candlelit dinner. So, why should you bother with the color of light?

One big reason is that it can affect your health and ability to keep your internal body clock in sync. This mechanism developed in our evolution when we were exposed to bright, bluish daylight in the morning and warm, yellowish light from a campfire in the evening before bedtime.

Usually, we get enough blue light when we’re outdoors, especially in the morning. But if you’re stuck indoors without access to natural light, you’ll need to get your light from lamps. Lamps with high color temperatures, like 4000K or higher, usually have a lot of blue light. And here’s the kicker: avoiding exposure to blue light in the evening is crucial if you want a good night’s sleep. Conversely, low-color temperature lamps, like dimmed incandescent bulbs, have very little blue light and can provide enough light in the evening while steering clear of the sleep-disrupting blue light starting in the late afternoon.

Another reason to think about light color is for style and design in lighting and architecture. For visual appeal, all your lamps should have the same color. Sometimes, lamps get swapped out without considering their color, which can give a not-so-great impression of a space. So, paying attention to color is essential to ensure everything matches seamlessly.

When discussing the color of white light, we use a set of “chromaticity coordinates.” One of these coordinates is correlated color temperature, which historically refers to incandescent lamps’ filament temperature.

The other necessary chromaticity coordinate is called “Tint,” whose value wasn’t much of a concern when we used incandescent lamps because they naturally had no significant tint. But with fluorescent and LED lights, which don’t have an inherent color temperature, we must be precise about specifying and controlling it. Manufacturers define chromaticity tolerances for their products to make things easier, mainly following standards set by organizations like ANSI/NEMA.

This book dives deep into white light’s chromaticity, how we specify it, the acceptable variations, and the industry standards that guide us. It also introduces an improved method for calculating correlated color temperature and tint, building upon the original method described by Robertson.

CIE·JS WebAssembly Library Programming Manual

The Color & Illumination Engineering JavaScript Library, or CIE·JS, is a powerful tool for basic and advanced color calculations. It’s designed to work seamlessly within web applications and shell scripts using a JavaScript runtime tool like Deno.

What sets this library apart from conventional color calculation libraries are its unique features:

  1. Spectral Foundations: Instead of relying on just three color values (e.g., RGB), CIE·JS employs spectral distributions as the fundamental basis for its calculations. This means that arrays of spectral power or reflectivity values represent colors. Even if you input three color values, the library will construct a spectral distribution based on additional information, like camera color profiles, or apply a default if none is available. This approach significantly enhances the precision of color calculations, allowing you to determine color appearances accurately for specific observers and viewing conditions.

  2. Extensive Online Database: The library has access to a comprehensive online database containing spectral distributions of light sources, surface colors, display primaries, and sensor spectral sensitivities. It covers all standard observers and offers the flexibility to specify custom observers. Spectral data is fetched from the online database on demand to maintain the library’s compact size.

  3. Blazing Speed and Security: CIE·JS is written in Rust, a programming language known for its exceptional speed and security. You don’t need to be familiar with Rust to use the library, as it’s packaged as a WebAssembly library, compatible with various other languages like JavaScript and Python.

  4. Easy Integration: Integrating CIE-JS into web applications is straightforward. You can add just two lines of JavaScript code within your HTML files. Compiling or complex installations are unnecessary and compatible with modern computing platforms, including mobile devices.

  5. Shell Scripting: Beyond web applications, CIE·JS can also be utilized through simple shell scripts, making it a convenient and rapid color calculator for various colorimetric evaluations.

In essence, CIE·JS offers a versatile and precise approach to color calculations, backed by a comprehensive database and powered by the speed and security of the Rust programming language. Whether you’re developing web applications or need quick color analysis through shell scripts, this library has you covered.

If you want to learn more, please let me know by using this form, and I can send you a link to the pre-release documentation of the (online) book.