Abstract
Multi-primary LED systems add amber, lime or white emitters to the red, green and blue primaries of a conventional RGB fixture. This article examines what those additional channels contribute, why the RGB-plus-white colour model used by most LED controllers cannot exploit them fully, and how a calibrated conversion stage can be added to WLED, an open-source ESP32 lighting controller, so that ordinary colour requests are rendered through four or five independently characterised emitters.
A linear colour-mixing model is developed for an RGBL fixture based on the Cree XNPAPL package and extended to a discrete five-channel RGBAL arrangement. The model shows that amber and phosphor-converted lime lie inside the RGB chromaticity triangle and therefore do not extend the gamut, but that they increase the luminance available at a given chromaticity by a factor of 1.7 at D65 and by more than five at amber and lime chromaticities, while raising the CRI of a D65 white from 38.6 to 68.7. A sweep of the Planckian locus identifies 3000 K as the design white point, and a luminance-headroom analysis shows that limiting the white recipe to 85% of peak luminance improves CRI by 8.9 points and R9 by nearly 38 points.
The firmware fork implements the conversion as a 17³ lookup table, solved offline by convex optimisation and interpolated tetrahedrally on the device in linear light with 16-bit channel precision. The closed-loop calibration method, in which each emitter is measured with a spectrometer, the channel model is rebuilt from the measured spectra and the rendered output is verified by ΔE 2000, is described together with the hardware, thermal, optical and temporal-modulation requirements of an architectural luminaire.
Introduction
WLED is an open-source firmware for ESP8266 and ESP32 microcontrollers that is most commonly used to drive decorative addressable LED strips. It provides Wi-Fi provisioning, a mature web interface, presets, an effects library, JSON and MQTT interfaces, and integrations with home-automation platforms. It also supports analogue, PWM-driven outputs: single-colour, CCT, RGB, RGBW and five-channel RGBCCT buses, together with selected addressable RGBW and RGBCCT chipsets. The electrical control required for a five-output luminaire therefore already exists.
What WLED lacks is a colour model for more than three chromatic primaries. Its internal representation is an RGB triple, one white value and a separate correlated colour temperature (CCT) blend. That model suits fixtures whose additional channels are white emitters of fixed chromaticity, but it has no means of deciding how five emitters with different spectra should be combined to produce a specified white, pastel or saturated colour. A five-channel RGBAL fixture can be wired to the RGBCCT bus and driven, but the result is an approximation governed by white-handling logic rather than a colour calculation.
This article addresses that gap. Sections 2 and 3 describe the terminology and characteristics of RGBW, RGBWW, RGBCCT, RGBA, RGBL and RGBAL systems and the applications in which additional primaries are of value. Section 4 examines the colour model implemented by stock WLED. Section 5 develops the linear mixing theory for a fixture with more than three primaries, and Section 6 presents modelled results for the candidate emitters. Section 7 describes the WLED_RGBAL firmware fork, which adds four- and five-primary PWM bus types, a spectrometer-derived lookup table, 16-bit internal channel data and a calibration interface. Sections 8 to 11 cover the hardware architecture of the luminaire, the temporal-modulation requirements imposed by cameras, the closed-loop calibration method and the considerations that shape the optimisation.
Development approach
Two configurations are used. During commissioning, while the optics, thermal design and driver stage are being developed, the fixture is driven through stock WLED's RGBCCT output with the two nominal white channels mapped to amber and lime. Once the emitters and drivers are stable enough to be measured, the fixture is moved to the RGBAL fork and a colour profile calibrated to the finished hardware. This separation allows electrical and mechanical work to proceed on stock firmware while the colour engine is developed against a simulated fixture.
Multi-primary LED systems
Each letter in a channel designation normally represents one independently driven emitter colour. The naming is not applied consistently across strips, fixtures and marketplaces, and the same label can describe products with different channel counts. The part number, pinout and channel diagram are therefore more reliable than the acronym in a product listing. Table 1 summarises the common systems.
| System | Physical channels | Function of the additional channel | Typical strengths | Typical applications | Stock WLED support |
|---|---|---|---|---|---|
| RGB | 3 | None. White is produced by mixing red, green and blue. | Saturated colour, low cost, effects and pixel work. | Decorative strips, signage, gaming, pixels and displays. | Native |
| RGBW | 4 | A dedicated white emitter, which may be warm, neutral or cool. The letter alone does not indicate which. | More efficient and usually more convincing white than RGB alone. | Cove lighting, smart lamps, hospitality and general accent light. | Native |
| RGBWW | 4 or 5 | An ambiguous label. WW can denote one warm-white channel or serve as retail shorthand for two white channels. | Warm white or tunable white, depending on the product. The data sheet must be checked. | Stage fixtures, smart lamps and constant-voltage strip. | Depends on the actual channel count |
| RGBCCT | 5 | Separate warm-white and cool-white channels, blended to change correlated colour temperature. | Decorative colour plus efficient, adjustable white for everyday illumination. | Architectural strip, smart bulbs, task lighting and circadian-style scenes. | Native as PWM. Selected addressable chipsets are also supported. |
| RGBA | 4 | Amber supplies a direct warm primary instead of synthesising every orange from red and green. | Rich ambers, warmer pastels, tungsten-like looks and useful skin-tone control. | Theatre, event wash, scenery, décor and entertainment lighting. | Not a native colour model |
| RGBL | 4 | Lime is commonly a phosphor-converted, relatively broad green-yellow source. | Bright pastels and whites, useful mid-spectrum energy and improved rendering potential. | Theatre, studio, broadcast, architectural and high-output colour mixing. | Not a native colour model |
| RGBAL | 5 | Amber and lime add two alternative spectral routes through the warm and middle parts of the spectrum. | A flexible engine for saturated colour, nuanced pastels and adjustable white recipes. | Custom architectural luminaires, theatre, studio and research fixtures. | Five outputs can be repurposed. True RGBAL mixing requires custom logic. |
RGBW One white
RGB can produce a visual white point, but three narrow peaks render coloured objects poorly. A dedicated white LED contributes a broad phosphor-generated band, improves luminous efficacy and makes the system more suitable for general illumination.
The limitation is a fixed white character. A 2700 K white channel is always warm and a 6500 K channel always cool. RGB can tint either, but that is not equivalent to two measured white endpoints.
RGBCCT Two whites
This is the practical general-purpose configuration for interior lighting. Warm-white and cool-white channels are cross-faded for working, relaxation and camera presets, while RGB provides decorative colour. WLED supports this model explicitly and exposes a CCT control.
It is usually the most direct route to high-quality white, because the white LEDs themselves can be specified for CRI, R9, CCT and Duv.
RGBA Warm primary
Amber is common in stage and event fixtures because it gives a direct route to warm oranges, firelight and low-CCT looks. Commercial RGBA fixtures are used for stages, dance floors, scenery and performers, and current examples quote broad CCT adjustment with CRI above 90.
An amber channel does not by itself guarantee high-quality white. Its dominant wavelength, bandwidth and balance against the other emitters remain decisive.
RGBL Middle spectrum
Lime provides a broad, efficient contribution through the green-yellow region where the eye is most sensitive. Compact theatrical fixtures use RGBL to produce bright colour and high-quality white, and LED manufacturers offer RGBL packages specifically for stage and architectural lighting.
The broad mid-spectrum output makes pastels brighter and provides a smoother route to white than narrow RGB peaks alone.
Combining amber and lime
RGBAL provides the mixer with more than one route to a given target colour. Amber produces warm oranges directly rather than through an inefficient red-and-green mixture. Lime supplies efficient mid-spectrum energy for whites and pastels, while amber adds long-wavelength content that improves the rendering of skin and other warm materials. The additional freedom can be used to improve luminous output, colour rendition, electrical load or thermal headroom, depending on the objective chosen for the mixer.
RGBAL does not in general enlarge the outer colour gamut. Amber and lime usually sit inside the triangle formed by the RGB primaries on a chromaticity diagram, so their value lies in spectral quality and efficiency within that gamut rather than in new boundary colours. Section 6 quantifies this for the candidate emitters.
Applications
Additional primaries are most valuable when a fixture must illuminate real materials rather than simply produce coloured light. Four application areas illustrate the requirement.
Architectural interiors
Coves, niches, feature walls, reception areas and hospitality spaces require attractive colour but spend most of their operating life producing convincing white.
Theatre and events
Designers require saturated colours, gel-like pastels, flattering skin tones and smooth transitions without changing filters or fixtures.
Film, broadcast and video
Colour rendition, tint control, silent cooling and flicker behaviour matter as much as the appearance of the light to the eye.
Retail and display
Food, timber, fabric, paint and skin each expose gaps in a source's spectrum. A matching CCT alone does not guarantee that they look correct.
Two sources can have nearly identical chromaticity and CCT while producing very different spectral power distributions. Materials reflect those spectra differently, so timber, red paint or skin may appear natural under one source and flat under the other. Chromaticity alone is therefore an incomplete specification for illumination.
The colour rendering index (CRI, or Ra) remains the familiar shorthand for rendering quality, but it reduces the subject to a single average over eight moderately saturated test samples. The supplementary index R9 reports saturated red, which Ra treats poorly. IES TM-30 was developed to address these limitations and adds a fidelity index (Rf), a gamut index (Rg) and hue-specific information. These metrics are used throughout this article to compare candidate recipes.
The colour model implemented by WLED
WLED's documented light capabilities are RGB, white and CCT. Its JSON colour array holds three or four values for RGB or RGBW, and each segment stores CCT as a separate quantity. This representation suits RGBCCT fixtures: the fourth colour value sets the white level, and the CCT value divides it between the warm-white and cool-white emitters.
Analogue single-colour, CCT, RGB, RGBW and RGBCCT outputs have been supported since WLED 0.13.1, and the addressable WS2805 and FW1906 RGBCCT devices since 0.15.0-b2. These are genuine five-channel modes, but they operate on the RGB-plus-white-and-temperature model rather than on a general five-primary colour vector. The PWM bus implementation makes this explicit. The five-channel type is designated PWM RGBCCT; it writes RGB directly, derives the warm-white and cold-white values from the white level and CCT, and sends them to channels four and five.
Mapping the white channels to amber and lime
The mapping is electrically valid. The nominal warm-white output drives amber and the cold-white output drives lime. WLED's white slider then controls their combined level and the CCT slider shifts the balance from amber to lime.
The result is an approximation rather than five-primary colour management. WLED continues to treat the two channels as a white-temperature pair. The auto-white function can add them whenever it extracts a white component from RGB. Effects generate RGB values and so do not exercise the additional pair as a five-primary mixer would. The CCT additive-blending setting determines how strongly both channels can be driven near the centre of the range, and WLED's documentation notes that high additive blending increases heat and reduces LED life.
Integration approaches
Three arrangements are available for driving a four- or five-emitter fixture from WLED. They serve different purposes and are not mutually exclusive.
Repurpose the RGBCCT bus
Configure one five-channel PWM output, wire the warm-white output to amber and the cold-white output to lime, set auto-white to None while characterising the hardware, and use solid-colour presets. This is the most direct route to a coherent five-emitter fixture on stock firmware.
Expose channels as separate buses
Separate single-channel PWM buses or segments allow each emitter to be commissioned and measured individually. The arrangement is cumbersome in normal use and does not constitute a unified colour engine.
Add a calibrated multi-primary mixer
Retain WLED for network control and presets, but translate its requested RGB and white scene into four or five linear drive values using measured data. The conversion can reside in a bus or core patch, as in the fork described in Section 7, or in a companion controller.
Example: JSON control of the repurposed RGBCCT bus
These examples assume a solid effect, amber connected to the warm-white PWM output, lime connected to the cold-white output, and WLED auto-white set to None. The actual amber and lime split also depends on the configured CCT blending mode.
Amber end of the range, RGB off:
{"on":true,"bri":160,"seg":[{"id":0,"fx":0,"col":[[0,0,0,255]],"cct":0}]}Mixed RGB with an amber-biased amber and lime contribution:
{"on":true,"bri":160,"seg":[{"id":0,"fx":0,"col":[[180,35,8,140]],"cct":96}]}These are control examples, not calibrated colour recipes. Measured looks are saved as WLED presets once the hardware is stable.
Colour mixing with more than three primaries
At fixed junction temperature and drive current, additive light mixing is linear. The CIE XYZ tristimulus contribution of each emitter at full drive can be measured and arranged as the columns of a matrix. A target colour is then expressed as a weighted combination of the channels:
where M is the 3 × 5 matrix of measured emitter tristimulus values and the channel vector holds the linear drive fraction of each emitter. With three tristimulus constraints and five controls the system is under-determined: a two-dimensional family of channel mixtures produces the same chromaticity and luminance. That freedom is the reason the additional channels are useful. A solver can select, from the family, the mixture that uses least power, remains within channel limits, minimises spectral discontinuities, balances junction temperatures or most closely matches a reference illuminant.
A practical solver constrains channel values to be non-negative and within current limits. It also requires measured dimming curves, because PWM duty, optical output and perceived brightness are three distinct quantities.
Chromaticity matching and spectral matching
The tristimulus matrix places the output at a specified chromaticity, but CRI and TM-30 depend on the complete spectral power distribution. Two mixtures with identical chromaticity can render objects differently. A calibrated mixer therefore needs a second objective, evaluated on the spectra, to choose among the metameric mixtures. Without one, the alternative is to rely on individually measured recipes rather than on general colourimetric accuracy.
Direct control and calibrated control
Direct control of individual channels is appropriate for bench measurement and for isolating single emitters, but it offers no fixture-to-fixture consistency. LED wavelength and flux vary with bin and temperature, and nominally identical emitters differ measurably, which is why professional manufacturers calibrate each luminaire individually.
The firmware fork described in Section 7 applies this approach. The colour cube is solved offline against measured data, the result is stored as a compact lookup table, and the ESP32 performs only interpolation at run time. The optimisation is carried out once, during calibration, rather than for every rendered frame.
Emitter modelling
The emitter model places amber and phosphor-converted lime inside the triangle formed by red, green and blue on the CIE 1931 chromaticity diagram. Neither adds a boundary colour, but both provide brighter and spectrally fuller routes to colours that RGB can already reach.
The initial model is based on the Cree XNPAPL package, with red at approximately 625 nm, green at 528 nm, blue at 458 nm and a modelled phosphor-converted lime peaking near 558 nm. Adding lime leaves the area of the chromaticity hull unchanged to four decimal places, while substantially changing the predicted luminance and colour-rendering performance. Figure 1 shows the geometry.
Luminance and rendering within the gamut
Table 2 compares the modelled luminance available at four target chromaticities with and without the amber and lime channels, together with the CRI of the resulting D65 white. The luminance values are relative model outputs and are comparable only with each other.
| Modelled target | RGB only | With amber and lime | Change | Interpretation |
|---|---|---|---|---|
| Amber chromaticity | 7,488 | 39,797 | 5.31× | A direct amber route avoids an inefficient red-and-green mixture. |
| Lime chromaticity | 15,245 | 91,100 | 5.98× | Phosphor-converted lime places broad output close to the eye's peak sensitivity. |
| D65 white | 15,485 | 26,118 | 1.69× | The same white point is reached with substantially more light. |
| CRI Ra at D65 | 38.6 | 68.7 | +30.1 | Broad emitters fill some of the spectral gaps between narrow RGB peaks. |
Candidate emitters
The first hardware build uses an RGBL package rather than the final five-colour arrangement. The four-die Cree package places every source within one optical footprint, which simplifies colour mixing on the first board. The RGBAL version uses discrete emitters, which permits free choice of each primary but makes mechanical alignment and beam homogenisation more demanding. Table 3 summarises the candidates.
| Candidate | Channels | Selection rationale | Principal compromise |
|---|---|---|---|
| Cree XNPAPL | RGB + PC lime | Initial build. Four dies share one package and one optical centre. | Demonstrates RGBL rather than a complete RGBAL engine. |
| Cree XNPAPA | RGB + PC amber | A direct warm channel and a potentially stronger route to some warm whites. | The model predicts much lower efficacy and weak R9. |
| LUXEON C, discrete | R/G/B or royal blue, A, L | A genuine five-channel RGBAL arrangement with free choice of every primary. | Several source positions make beam homogenisation considerably harder. |
Selection of the design white point
A sweep of the Planckian locus from 2200 K to 6500 K (Table 4) shows that 3000 K gives the best overall balance of CRI Ra, TM-30 Rf and saturated-red rendering R9. Moving to 2700 K improves Ra by only 0.1 point but reduces R9 by almost 12 points, which is a poor exchange for skin, timber and other warm materials. Higher colour temperatures raise the modelled efficacy but reduce both fidelity indices.
| White point | CRI Ra | TM-30 Rf | R9 | Modelled efficacy |
|---|---|---|---|---|
| 2200 K | 85.2 | 87.7 | 70.5 | 97.6 lm/W |
| 2700 K | 91.0 | 88.2 | 85.3 | 104.1 lm/W |
| 3000 K (selected) | 90.9 | 88.0 | 97.1 | 106.8 lm/W |
| 3500 K | 90.2 | 87.4 | 94.4 | 109.7 lm/W |
| 4000 K | 89.7 | 86.7 | 94.2 | 111.3 lm/W |
| 5000 K | 89.4 | 85.6 | 91.3 | 112.4 lm/W |
| 6500 K | 88.8 | 84.2 | 88.8 | 111.4 lm/W |
Further observations from the model
Royal blue extends the gamut. Unlike amber and lime, substituting a shorter-wavelength royal blue for the standard blue die moves an outer vertex of the RGB triangle. The model predicts approximately 4.8% more chromaticity area, together with higher TM-30 Rf and efficacy. Standard blue retains a small Ra advantage, which illustrates that Ra and TM-30 measure different aspects of colour quality.
The optimised warm-white recipe excludes the green die. At and below 3000 K the model's best white sets the narrow green emitter to zero. Broad lime peaks in a similar region and supplies the required luminance more efficiently. Green remains necessary for saturated greens and cyans, but it is not the preferred contributor to the warm-white recipe.
Firmware architecture
The fork does not modify WLED's effects or interface to understand amber and lime. In the WLED 0.16-dev codebase on which it is based, perceptual processing is applied before the PWM bus receives the colour. The multi-primary bus therefore receives a linear-light RGB request, interpolates the calibrated table and produces four or five physical channel values.
Table 5 lists the components of the implementation and their function. The colour science is concentrated in a host toolchain so that the device performs only table interpolation.
| Component | Implementation | Function |
|---|---|---|
| Multi-primary buses | Four-pin RGB+X and five-pin RGBAL PWM bus types, 16-bit internal channel data and a raw-drive override. | Supports normal rendering and direct per-die bench measurement through the same firmware. |
| Calibration profile | A 17³ binary lookup table on LittleFS with CRC validation, tetrahedral interpolation and hot-loading without a reboot. | Keeps fixture-specific measurements out of the firmware image while preserving a safe pass-through mode. |
| Host toolchain | Spectral ingest, CIE integration, emitter models, convex optimisation, gamut mapping, smoothing and profile generation. | Performs the colour science offline rather than within every ESP32 frame. |
| Verification tooling | Commands known colours, measures the rendered beam and compares output with intent using ΔE 2000. | Converts an internally consistent model into a calibrated luminaire. |
+4.3 kB
The fork adds 4.3 kB of flash and eight bytes of RAM to the classic ESP32 build.
29 targets
The fork builds for all 29 continuous-integration targets, including ESP8266 and the ESP32 S3, C3, C5 and P4 variants.
33,000 points
The firmware and Python reference interpolators agree to zero least-significant-bit difference across 33,000 test points.
Degrees of freedom in drive space
Section 5 showed that five drives and three colour constraints leave two free dimensions. Figure 2 illustrates one of them: a line through two-channel drive space along which every point produces the same colour to the eye but a different spectrum. The offline optimiser selects a point on that line according to the chosen balance of efficacy and spectral fidelity, and the selected value is what the lookup table stores.
Design decisions
- A lookup table rather than a run-time optimiser. Five primaries and three colour constraints leave a family of possible mixtures, and selecting among them is computationally expensive. Interpolating a pre-solved 17³ grid is inexpensive and deterministic.
- Tetrahedral rather than trilinear interpolation. Tetrahedral interpolation produces far less drift along the neutral axis, where even a slight colour cast is visible.
- The profile resides on LittleFS. The table of approximately 48 kB is fixture-specific data. Storing it on the filesystem keeps it out of compile-time flash and allows replacement without a firmware rebuild.
- The table is indexed in linear light. The mapping is smoother and easier to approximate in linear space, and a user-adjusted display gamma cannot silently invalidate the calibration.
- Internal channel values are 16-bit. Low-level five-primary mixtures frequently depend on small differences between channels. Retaining precision avoids discarding timer resolution before the PWM stage.
- Bus identifiers come from a reserved block. The fork uses types 96 and 97, leaving upstream PWM numbering untouched.
Simulated profile performance
For the modelled Cree RGBL fixture at 3000 K, the 17³ profile produces CRI 89.1, TM-30 Rf 87.8 and a 3005 K white. Of the 4,913 grid points, 327 (6.7%) require gamut mapping. Across 2,898 in-gamut test colours passed through the quantised table, the mean ΔE 2000 is 0.02 and the maximum is 1.40.
These figures characterise the lookup table, not the emitter model. A low interpolation error shows that the table reproduces the model's solution with little additional error; it does not show that the model's spectra match the physical emitters. An inaccurate spectral model produces inaccurate output however precisely the table reproduces it, which is why the calibration method in Section 10 rebuilds the model from measured spectra.
Luminaire hardware
The design treats the fixture as a luminaire first and a WLED project second. The ESP32 provides the control interface, the colour-mapping stage converts requests into channel values, a driver stage converts those values into regulated emitter currents, and the optical engine combines the emitters into a single beam.
Controller
An ESP32 is used because it provides the processing headroom and LittleFS capacity needed for the calibration profile, together with a considerably higher default PWM frequency than the ESP8266 (Section 9).
Output stage
WLED's GPIO pins are control signals, not LED power outputs. A constant-voltage strip requires a suitable switching device per channel, and high-power emitters require regulated constant-current drivers. The output stage includes a defined off-state bias, gate or input resistors, hardware current limits, fusing and a safe power-up state. WLED's own guidance for analogue strips likewise calls for external MOSFET circuitry and protection against overload and over-temperature.
Thermal design
Thermal assessment uses the worst credible channel mixture rather than a single emitter at full output. A centre CCT blend activates amber and lime together, and a calibrated RGBAL recipe may run several channels at high current simultaneously. A temperature sensor near the LED substrate controls thermal derating, and photometric measurements are taken only after the heatsink has reached equilibrium, since stable temperature is a prerequisite for stable colour.
Optics
Several visibly distinct sources require sufficient mixing distance or a reflector or homogenising optic. The four-die Cree package gives the RGBL build a shared optical footprint; the discrete RGBAL version is less forgiving. A diffuser may conceal the individual emitters when viewed directly yet still cast coloured shadows onto nearby objects. Beam uniformity is therefore assessed at the intended installation distance, across the edge of the field and at low dim levels.
Design requirements
Temporal light modulation and camera compatibility
A PWM-dimmed luminaire can appear steady to the eye while producing rolling bands or exposure variation on camera. WLED's default analogue PWM frequency is 19,531 Hz on the ESP32, compared with 880 Hz on the ESP8266, and this is one reason for selecting the ESP32. The higher frequency avoids many common camera artefacts but does not guarantee their absence: shutter time, frame rate, rolling-shutter readout, PWM bit depth, driver behaviour and low-duty operation can all interact.
Higher PWM frequency also reduces the available PWM resolution and increases switching loss. WLED derives the PWM bit depth from the frequency and the timer clock, so the highest available frequency is not necessarily the best setting. Frequency is in any case only one component of flicker performance. Modulation depth, duty cycle and waveform shape also matter, particularly on camera, and output should be measured across the dimming range rather than assumed to be flicker-free. The following tests form the assessment.
Calibration method
Calibration replaces the provisional emitter model with measurements of the finished fixture, generates a fixture-specific lookup table and verifies the rendered output against intent. Figure 3 shows the closed-loop workflow, and the numbered procedure follows.
- Stabilise the mechanics, currents and temperature. The heatsink, optic, drive current and permitted simultaneous-channel load are finalised first. Cold-start drift is recorded, and the profile is built only after thermal equilibrium.
- Drive one emitter at a known duty. The fork's raw override bypasses the lookup table, auto-white handling and WLED's perceptual brightness curve. The bypass is essential: without it a nominal 50% request can correspond to roughly 12% duty, and the calibration would learn the wrong transfer function.
- Capture each spectrum at several levels. An Avantes AvaSpec 2048-2 spectrometer measures each die across a sweep of duty levels. Several levels are required because driver droop, LED heating and supply sag distort the flux-versus-duty relationship.
- Build the channel model. Each spectrum is integrated against the CIE colour-matching functions to obtain its XYZ contribution. The results form the 3 × N matrix and replace the provisional emitter model with data from the finished fixture.
- Select the white point and headroom. The luminance ceiling is swept to locate the knee at which additional brightness begins to cost a disproportionate amount of colour quality.
- Solve the colour cube. The toolchain solves 4,913 small convex problems, one per grid point, in about six seconds. In-gamut points balance colour accuracy, rendering and efficiency. Out-of-gamut requests are reduced in chroma while hue and lightness are held as steady as possible.
- Upload with validation. The device checks the profile signature, version, geometry and CRC before hot-loading it. A rejected file leaves the previous calibration active.
- Close the loop. Known colours are commanded, the beam is re-measured and ΔE 2000 is calculated against intent. The check is repeated at low output, after thermal soak and across the expected ambient range.
- Store verified recipes as presets. Proven architectural and camera looks are stored as WLED presets so that every installation recalls identical states.
Luminance headroom
At the absolute luminance ceiling the three colour constraints can fully determine the channel mixture, leaving the optimiser no freedom to improve the spectrum. Reducing the target luminance restores that freedom. Table 6 shows the effect on the modelled 3000 K recipe.
| Headroom setting | Relative luminance | CRI Ra | TM-30 Rf | R9 | Modelled efficacy |
|---|---|---|---|---|---|
| 1.00 | 100% | 80.2 | 86.9 | 35.7 | 98.2 lm/W |
| 0.90 | 90% | 86.5 | 88.0 | 60.1 | 101.5 lm/W |
| 0.85 (selected) | 85% | 89.1 | 87.8 | 73.5 | 103.3 lm/W |
| 0.80 | 80% | 89.1 | 87.8 | 73.5 | 103.3 lm/W |
In the model, limiting the recipe to 85% of peak luminance improves CRI by 8.9 points, R9 by nearly 38 points and efficacy by about 5%. Below 0.85 the solution no longer changes, which identifies that setting as the knee. WLED's master brightness then scales all channels together, so the spectral mix is preserved at lower brightness levels.
Instrumentation
A spectrometer is the reference instrument for this method because the rendering metrics and the fidelity objective both require the full spectral power distribution. A tristimulus colour meter can supply usable chromaticity and luminance for the basic mixing matrix, but it cannot reveal spectral discontinuities or support reliable rendering metrics. A camera or phone is useful for demonstrating a result but is unsuitable as the sole calibration instrument. Where no spectrometer is available, a single comprehensive measurement session with a borrowed or hired instrument yields more than further iterations of unmeasured firmware.
Formulation considerations
Four aspects of the optimisation and verification formulation have a disproportionate effect on the result. Each produces plausible but incorrect output when handled naively, and the treatment adopted in the toolchain is recorded here.
Fidelity objective
Minimising the raw spectral distance between a candidate mixture and a 3000 K blackbody places excessive weight on red and infrared energy that the LEDs cannot produce. The optimiser compensates by driving amber hard, and the resulting mixture scores CRI 82.9 where a simple power-minimised mix scores 87.2.
The adopted objective instead compares how the candidate spectrum renders 99 real reflectance samples against the reference. This keeps the optimisation convex while evaluating the appearance of objects rather than a wavelength-by-wavelength match.
CIELAB reference illuminant
The CIELAB conversion in the colour-science library expects the reference illuminant as xy chromaticity rather than XYZ. Supplying the wrong form produces a nominal white with b* near 1805 and chroma values near 1351, which are physically impossible.
With the illuminant supplied correctly, out-of-gamut hue error is 0.0° in the test set and the maximum lookup-table error is 1.40 ΔE rather than a meaningless 6.67.
Interpolation consistency in verification
The accuracy check must generate its reference using the same interpolation as the firmware. A verifier that interpolates trilinearly while the firmware reads the table tetrahedrally reports the difference between the two interpolation methods rather than the colour error of the firmware.
Localised smoothing
Independent per-point solutions can change abruptly when a constraint becomes active, which suggests smoothing the table. Applied globally, however, smoothing pulls the selected white point towards neighbouring compromises and reduces CRI by about seven points.
The adopted method applies stronger smoothing where the solution is arbitrary and minimal smoothing on the neutral axis, where the mixture is deliberate.
Sources of error in a physical fixture
- Ambiguous naming: RGBWW does not indicate whether four or five channels are controllable.
- Common-anode and common-cathode hardware: the driver topology and polarity setting must match the LEDs. Software cannot correct a hardware mismatch.
- Auto-white: WLED can derive white from RGB, which in the repurposed RGBAL mapping adds amber or lime unexpectedly. Manual white should be used during characterisation.
- CCT blend heat: additive centre blending can drive both secondary channels hard. That case must be tested against the current limits and the thermal design.
- Power estimation: WLED's brightness limiter is useful, but a high-power analogue engine still needs hardware limits and a supply sized from measured loads.
- Thermal colour drift: flux and wavelength move with temperature. A temperature-stable fixture is easier to calibrate and to match.
- Optical separation: a diffuser that appears uniform at ten centimetres can still cast separated colour shadows at the wall.
- Low-level dimming: the bottom few per cent expose PWM resolution, driver turn-on thresholds, channel mismatch and camera banding.
- Visual calibration: the visual system adapts quickly. Side-by-side references and instruments prevent an approximate match from becoming a permanent coefficient table.
- Network exposure: WLED is a local controller. A luminaire's web interface should not be exposed directly to the public internet.
Conclusion
The value of an RGBAL emitter set lies not in a larger gamut but in the additional routes it provides to colours within the RGB triangle. Red, green and blue define the boundary. Amber supplies warmth without a red-and-green compromise, and lime fills an efficient region of the middle spectrum. Together they allow an architectural luminaire to produce saturated colour and considerably better pale and white light than a three-primary engine.
WLED is a suitable foundation because it already provides Wi-Fi provisioning, a mature interface, presets, APIs and effects, and because its RGBCCT output can drive a five-emitter fixture during commissioning. Its colour model, however, is limited to RGB plus white and CCT. The fork resolves this by placing a measured conversion stage after WLED's perceptual processing. A 17³ lookup table, solved offline by convex optimisation and interpolated tetrahedrally in linear light with 16-bit precision, converts ordinary colour requests into four or five calibrated drive values without changes to the effects or interface.
The modelled results identify 3000 K as the design white point, show that the optimised warm white omits the green die, and show that limiting the recipe to 85% of peak luminance yields a substantial gain in colour quality for a modest loss of output. These are model results, conditional on the assumed emitter spectra and in particular on the lime spectrum. The calibration method of Section 10 is the means by which the model is replaced with measured data and the rendered output verified by ΔE 2000, and the same measurements determine the fixture's dimming behaviour, thermal drift and optical mixing.