Repository navigation
Description
References
Originated from a Reddit discussion with user Joeyjoe9876 ("Sonia"). The two primary references for this issue are:
- Math model writeup (authoritative spec): https://gist.github.com/JChalka/915603d7930b7216d5c5aae834ec2ea9
- Reference implementation + LUT builder: https://gist.github.com/JChalka/cebc5a018066cae05d98cf9088c3b3b9 (
xy_target_rgbw.py)
Implementers should treat the math-model gist as the algorithmic contract for this issue. The Python implementation is a working cross-check, not a vendoring target — see Decisions below on licensing.
Context
FastLED's current RGBW conversion functions (src/fl/gfx/rgbw.h) — rgb_2_rgbw_exact, rgb_2_rgbw_max_brightness, rgb_2_rgbw_white_boosted, rgb_2_rgbw_null_white_pixel — all derive the white channel from some variant of min(R, G, B) and subtract residuals from the colored channels. This is the textbook approach, but on real hardware it produces visibly off-white output, because:
-
The white diode has its own native chromaticity (CCT-dependent), so
min(R,G,B)mixed light + W diode light is not on the requested white point. -
The four diodes have wildly unequal luminance. Measured BTF Lighting 6000K RGBW (off-wall):
- R: ~155 nits
- G: ~566 nits
- B: ~130 nits
- W: ~1544 nits
Treating them as equal-weight before residual subtraction means the output ratios do not reproduce the requested chromaticity.
Existing scaffolding that is relevant:
Rgbw::white_color_temp(defaultkRGBWDefaultColorTemp = 6000) is plumbed through everyrgb_2_rgbw_*function but is not actually consulted by any of the current implementations.RGBW_MODE::kRGBWUserFunction+set_rgb_2_rgbw_function()gives users a per-process override hook (FastLED 3.10.13+). This is the interim integration path for anyone wanting to drop Sonia's algorithm in today without touching the library.
Math model summary
The model is built from one shared primitive plus several mode-specific layers. Section numbers below refer to the math-model gist.
Shared simplex primitive (gist §2)
- xyY ↔ XYZ conversion:
X = (x/y)·Y,Y = Y,Z = ((1-x-y)/y)·Y; project to xy byxy = (X, Y)/(X+Y+Z). - 2D barycentric containment — for target chromaticity
Tand triangle verticesA, B, C, solve a 2×2 system for(λ_A, λ_B), deriveλ_C = 1 - λ_A - λ_B. Inside iff all λ ≥ -ε. - 3D XYZ solve — for a 3-emitter set
S = (a, b, c)with primary-XYZ matrixP_S, the channel weights aret_S = P_S⁻¹ · X_t. Physically valid iff allt_i ≥ -ε. - Brightness normalization — if
max(t_i) > 1, divide all participating channels by that max. Preserves chromaticity, reduces luminance to the maximum achievable inside the chosen topology.
These three operations are the entire computational core. Every mode below is a different way of choosing which simplex to feed them.
Out-of-hull projection (gist §3)
For named source gamuts (Rec709, Rec2020) the target may be physically unreachable. Use a constrained NNLS solve f* = argmin_{f≥0} ||Pf - X_t||² and replace the target with X_proj = P·f*. Builder and verifier must use the same projection — this is a correctness requirement, not a style choice.
Strict sub-gamut model (gist §5) — the algorithm from the Reddit post
W sits inside the RGB triangle and splits the hull into three sub-gamuts: RGW, RBW, BGW. Legal topologies: black, R, G, B, W, RG, RB, BG, RW, GW, BW, RGW, RBW, BGW.
function solve_strict_rgbw(source_rgb):
X_t = source_rgb_to_led_absolute_XYZ(source_rgb)
xy_t = XYZ_to_xy(X_t)
if near_black(X_t): return [0,0,0,0]
if xy_t outside hull: X_t, xy_t = project_to_model_hull(X_t)
for g in [RGW, RBW, BGW]:
if xy_t inside triangle(g.xy):
t = solve_xyz(g.P, X_t) # 3x3 inverse
if t non-negative:
return expand_and_normalize(t, g.channels)
# fallback: NNLS over each sub-gamut, pick min residual
Per-pixel cost: three triangle-containment tests + one 3×3 solve. Real-time viable; SIMD-friendly. This is the chromaticity-accurate mode.
WX / white-overdrive family (gist §§6–10)
Constrained ways to drive W harder than strict_subgamut while preserving chromaticity:
wx_lp_legacy(gist §9) — closed-form scalar LP. PrecomputeP_RGB⁻¹, then per pixel:Two 3×3 matrix multiplies + a min + a subtract. Cheapest WX mode; strongly recommended as the second mode to land after strict_subgamut.a = P_RGB⁻¹ · X_t # RGB-only solution d = P_RGB⁻¹ · P_W # RGB displacement per unit W w* = min(1, min_{i: d_i > 0} a_i / d_i) rgb* = max(a - w*·d, 0) f = [rgb*, w*] / max(1, max(f))wx_radial_virtual(gist §8) — casts ray from W through target xy to outer hull;ρ ∈ [0,1]controls W overdrive (ρ=0 ≈ strict; ρ=1 ≈ max overdrive). Reposes the other two sub-gamut virtual primaries with the same radial pose for consistency.wx_virtual_axis_maxbright(gist §10) — each sub-gamut's virtual primary chosen independently to favor high-W / high-Y. Less geometrically constrained; valuable on hardware profiles that reach higher safe luminance.
RGBCCT / multi-emitter (gist §§11–12)
Generalizes via emitter classification:
- Outer emitters — expand the device hull (e.g. yellow outside RG edge, violet outside BR edge); become new hull vertices.
- Inner emitters — live inside the hull (warm-white, cool-white, additional W); become alternate inner anchors.
- Edge emitters — on or near a hull edge; profile-configurable treatment.
For multiple inner anchors (e.g. RGBWW = RGB + warm-W + cool-W), solve target as RGB+WW yielding f_WW, again as RGB+CW yielding f_CW, then line-blend f = (1-η)·f_WW + η·f_CW where η is selected by CCT match / max Y / min RGB residual / measured dE / profile policy.
Reference results (measured by Sonia)
- Cyan input (0, 65535, 65535) → RGBW (0, 65458, 38474, 0), measured dE ≈ 0.519
- D65 white (65535, 65535, 65535) → RGBW (4289, 0, 13766, 65535), measured dE ≈ 1.720
- A LUT built straight off the math model (no measured ramp data) hit 75% pass rate at dE 2.5.
Proposal
Add a chromaticity-aware RGBW path to FastLED, landed in two phases:
Phase 1 — runtime solvers (no LUT, no content pipeline):
RGBW_MODE::kRGBWColorimetric— strict_subgamut, color-accurate, lowest brightness.RGBW_MODE::kRGBWColorimetricBoosted—wx_lp_legacy, color-accurate + maximizes W subject to RGB ≥ 0. Closed-form, ~2 matrix multiplies per pixel.- Both consume
Rgbw::white_color_temp(currently unused) plus aDiodeProfiledescribing the four diode xy + luminance ratios. - Ship one default profile (SK6812 RGBW3535 from datasheet xy + typical luminance ratios). Public API for users with a colorimeter to supply their own.
- Compile-time gated behind
#define FASTLED_RGBW_COLORIMETRIC(see Opt-in gating below).
Phase 2 — optional LUT path (later):
- 3D LUT with tetrahedral interpolation (gist §13) for users who want lower per-pixel cost or
wx_radial_virtual/ max-bright modes without per-frame work. - Build offline, load at runtime; precomputed coefficient_tetra layout for cheap MCU evaluation.
Phase 3 — multi-emitter (later still):
- Layered simplex (gist §12) for RGBWW / RGBCCT and added-emitter strips (yellow, violet, etc.). Track in a follow-up issue once the 4-channel path lands.
Memory footprint and LUT compaction
The naive 3D LUT is too big for general MCU use
vertex_tetra storage from gist §13 = grid_size³ × 4 channels × 2 bytes:
| grid_size | size | notes |
|---|---|---|
| 256³ | ~134 MB | host/desktop only |
| 65³ | ~2.2 MB | ESP32-S3 PSRAM |
| 33³ | ~287 KB | ESP32 PSRAM / large MCU |
| 17³ | ~39 KB | mid-tier MCU only — borderline |
| 9³ | ~5.8 KB | small MCU — too lossy for color work |
coefficient_tetra (per-cell 6-tetra affine) is ~5–10× larger for the same grid. Neither layout is acceptable as the default shape for FastLED, which has to fit alongside user code on small MCUs.
Why we can do dramatically better
The strict_subgamut math (gist §5) factors cleanly:
- Sub-gamut selection is a function of chromaticity
xyonly — independent of brightnessY. - Channel weights inside the chosen sub-gamut are barycentric-in-xy, then linearly scaled by
Y.
That means the interesting per-pixel work is two-dimensional (the xy plane), not three-dimensional (the full RGB cube). A 3D cube LUT spends storage on a dimension that is mathematically degenerate.
wx_lp_legacy (gist §9) is even better — it's closed-form scalar, so it needs no LUT at all, just P_RGB⁻¹ precomputed once per profile.
Recommended LUT design (Phase 2)
2D chromaticity LUT + 1D brightness ramp, indexed by (xy_t, Y_t) instead of (R, G, B):
- 2D cell:
(subgamut_id: 2 bits, λ_A: 8 bits, λ_B: 8 bits)—λ_C = 1 - λ_A - λ_Bis implied. Packed into 4 bytes (8-bit padding for alignment). - 1D Y ramp: 256 entries × 1 byte for the per-sub-gamut brightness-normalization curve (handles the
max(1, max(t))clamp from gist §2). - Profile constants: ~150 bytes (
P_RGB⁻¹,P_Wxy, three sub-gamut matrices, four emitter xy/Y, W color temp).
Sizing the 2D LUT at N × N × 4 bytes:
| grid N | 2D LUT | + Y ramp | + profile | total | accuracy target |
|---|---|---|---|---|---|
| 64 | 16 KB | 256 B | ~150 B | ~16.4 KB | high-fidelity, near-LUT |
| 32 | 4 KB | 256 B | ~150 B | ~4.4 KB | strong default for MCU |
| 16 | 1 KB | 256 B | ~150 B | ~1.4 KB | small MCU baseline |
Compare:
- 17³ vertex_tetra (naive): 39 KB → factored 32×32 + 1D: 4.4 KB. ~9× reduction at comparable color accuracy.
- 9³ vertex_tetra: 5.8 KB → factored 16×16 + 1D: 1.4 KB. ~4× reduction, plus the factored grid spends its cells where they matter (perceptual xy) rather than uniformly across the brightness axis.
Other compaction options (less recommended)
- 8-bit absolute cells instead of 16-bit in a vertex_tetra LUT: 2× reduction (17³ → 19.5 KB). Output drivers are usually 8-bit per channel anyway, so precision loss is bounded — but doesn't address the dimensional waste, just the per-cell waste.
- Delta LUT over the cheap baseline — store
Δ_RGBW = colorimetric_output − rgb_2_rgbw_exact_outputper cell at 4-bit signed per channel = 2 bytes/cell. 17³ → 9.8 KB. Loses precision when the correction is large (oversaturated white regions). - Per-octant sparse LUT — the cube splits into 8 octants, each naturally aligning with one sub-gamut. Skip empty cells. Saves ~25–50% but adds branching cost and metadata overhead.
- HSV-grid LUT —
32 × 16 × 16 × 4 bytes ≈ 32 KB. Conceptually appealing because hue is where accuracy actually matters, but RGB→HSV at runtime is more work than RGB→xy.
The 2D + 1D factorization wins on every axis (size, lookup cost, conceptual cleanliness) because it matches what the math actually does.
Measured accuracy and memory tradeoff (Python benchmark)
Built the closed-form strict_subgamut solver and the factored 2D+1D LUT in Python (scratch/rgbw_lut_bench.py) using Sonia's BTF Lighting 6000K RGBW diode profile. Test set: 4,300 RGB inputs (uniform random + dense brightness/saturation sweeps + canonical primaries/secondaries + Sonia's reference points). dE2000 measured between the closed-form output XYZ and the LUT output XYZ (so this is purely the error introduced by LUT interpolation — the closed-form is treated as ground truth). LUT cells assumed to be 8 bytes (4 channels × int16), plus a 256-byte 1D Y ramp.
| grid | cells | mem (B) | mem (KB) | dE mean | dE p50 | dE p95 | dE p99 | dE max | µs/px | speedup |
|---|---|---|---|---|---|---|---|---|---|---|
| 8×8 | 64 | 768 | 0.75 | 4.647 | 2.996 | 18.312 | 27.616 | 32.251 | 27.9 | 2.54× |
| 12×12 | 144 | 1,408 | 1.38 | 1.763 | 1.141 | 6.662 | 16.643 | 20.367 | 26.6 | 2.67× |
| 16×16 | 256 | 2,304 | 2.25 | 0.787 | 0.582 | 1.889 | 6.409 | 13.342 | 24.5 | 2.89× |
| 20×20 | 400 | 3,456 | 3.38 | 0.558 | 0.374 | 1.593 | 5.121 | 9.298 | 26.2 | 2.71× |
| 24×24 | 576 | 4,864 | 4.75 | 0.419 | 0.253 | 1.379 | 3.819 | 6.489 | 30.0 | 2.36× |
| 32×32 | 1,024 | 8,448 | 8.25 | 0.207 | 0.132 | 0.631 | 2.101 | 4.056 | 28.0 | 2.53× |
| 48×48 | 2,304 | 18,688 | 18.25 | 0.107 | 0.056 | 0.353 | 1.211 | 5.964 | 29.2 | 2.42× |
| 64×64 | 4,096 | 33,024 | 32.25 | 0.071 | 0.033 | 0.229 | 1.164 | 2.191 | 25.5 | 2.78× |
Closed-form reference timing: 70.9 µs/pixel (Python, single-thread, host CPU).
How to read the table
- dE < 1.0 is generally considered imperceptible; dE < 2.3 is a "just-noticeable difference" for typical observers.
- 16×16 (2.25 KB) hits sub-1 mean and p50 — perceptually equivalent on average, with rare worst-case spikes near sub-gamut boundaries. Solid choice for small MCUs.
- 32×32 (8.25 KB) hits sub-0.25 mean and sub-1 p95 — essentially indistinguishable for any practical use. Recommended default for the Phase 2 LUT.
- 64×64 (32.25 KB) is color-critical-application territory; rarely worth the storage on an MCU.
- 8×8 (0.75 KB) is too lossy — average dE > 4 is clearly visible.
- Max dE is dominated by sub-gamut boundary cells where bilinear interpolation crosses between RGW/RBW/BGW regions. P95/p99 better reflect typical experience.
Speed: Python vs C++ extrapolation
The "speedup" column above (2.4–2.9×) reflects Python+NumPy dispatch overhead, not the actual op-count ratio. The closed-form solver does: one P_inv @ X_t matvec + 1–3 barycentric containment tests + a max + a normalize. The LUT lookup does: bilinear interp on 4 channels (4 mul-adds × 4) + Y multiply + normalize. Op-count ratio in C++ would be roughly 5–10× faster for the LUT on an MCU (no Python dispatch, no allocation, tight integer loops).
Concrete extrapolation for ESP32-S3 at 240 MHz (rough, assumes hand-tuned C++):
- Closed-form: ~5–10 µs/pixel (~1,200–2,400 cycles) — float matvec + barycentric + normalize.
- 32×32 LUT: ~1–2 µs/pixel (~240–480 cycles) — integer bilinear + Y scale.
At 60 FPS on a 1,000-pixel strip: closed-form costs ~5–10 ms total (well within frame budget); LUT costs ~1–2 ms. Closed-form is fine for most applications. The LUT only pays off at high pixel counts or when running other heavy work in the same loop.
Updated Phase 1 vs Phase 2 storage recommendation
| phase | storage per profile | per-pixel cost (ESP32-S3 est.) | when to use |
|---|---|---|---|
Phase 1 — runtime solve (kRGBWColorimetric, kRGBWColorimetricBoosted) |
~150 B | ~5–10 µs, float | always, if FASTLED_RGBW_COLORIMETRIC |
| Phase 2 — 2D+1D LUT, 16×16 | ~2.3 KB | ~1–2 µs, integer | small MCU, accept p95 dE ≈ 1.9 |
| Phase 2 — 2D+1D LUT, 32×32 (recommended default) | ~8.3 KB | ~1–2 µs, integer | balanced MCU, p95 dE ≈ 0.63 |
| Phase 2 — 2D+1D LUT, 64×64 | ~32 KB | ~1–2 µs, integer | color-critical only |
| Naive 3D LUT (do not ship) | 39 KB – 134 MB | ~1–2 µs, integer | n/a — wastes a dimension |
Phase 1 ships first and is the only path implemented in the initial PR. The 2D+1D LUT is a follow-up only if profiling shows the runtime solve is too expensive on a real target — and even then it should ship gated behind a second flag (FASTLED_RGBW_COLORIMETRIC_LUT) so users who already opted into runtime colorimetric don't automatically pay LUT storage costs.
Opt-in gating
The colorimetric modes are off by default at compile time and gated behind:
#define FASTLED_RGBW_COLORIMETRIC 1Rationale:
- The new code path is intrinsically float (or fixed-point) and pulls in profile data, a simplex solver, and matrix-inverse precomputation. None of that should land in the binary on small MCUs that just want
kRGBWExactColors. - Matches the existing binary-bloat mitigation pattern in
src/fl/gfx/rgbw.cpp.hpp, where the user-function path was deliberately made lazy viaSingleton<Rgb2RgbwUserState>to keeprgb_2_rgbw_exactoff the static-init dependency graph (see issue [Tracking] Break unwanted cross-TU references that drag optional subsystems into all builds (follow-up to #2421) #2424). - Naming signals intent: "colorimetric" reads as "I want real color math" — opting in is a deliberate user choice, not an accidental default.
When FASTLED_RGBW_COLORIMETRIC is not defined:
kRGBWColorimetricandkRGBWColorimetricBoostedenum values still exist (so existing user code referencing them by name compiles).- Selecting either mode at runtime dispatches to a small stub function that:
- Emits
FL_WARN_ONCE("RGBW: kRGBWColorimetric requested but FASTLED_RGBW_COLORIMETRIC is not defined — falling back to kRGBWExactColors. Define FASTLED_RGBW_COLORIMETRIC=1 to enable the colorimetric path.")— using the existing macro fromsrc/fl/log/log.h. - Falls back to
rgb_2_rgbw_exact(the current default) for the actual conversion.
- Emits
- The stub itself is tiny (one warn-once branch + a tail-call to the existing exact path), so it does not pull in float math, profile data, or the simplex solver.
- This mirrors the pattern already established for
ChannelManagerruntime-driver selection andFastLED.add(cfg)(seesrc/fl/channels/README.md— same binary-size trade-off, same warn-once + fallback shape). - Provide a suppression flag for users who knowingly leave the modes selected for portability:
-DFASTLED_SUPPRESS_COLORIMETRIC_FALLBACK_WARNING(mirrorsFASTLED_SUPPRESS_RUNTIME_DRIVER_WARNING).
When FASTLED_RGBW_COLORIMETRIC is defined:
- The full code path links in: simplex solver, default
DiodeProfile,DiodeProfilesetter API, modes dispatch. - The stub + fallback path is not compiled — the dispatch goes straight to the real colorimetric implementations.
- All cost (flash, RAM, profile constants) lives behind the flag.
Acceptance criteria
- New
RGBW_MODEvariant(s) added: at minimumkRGBWColorimetricandkRGBWColorimetricBoosted.rgb_2_rgbw()dispatches to them whenFASTLED_RGBW_COLORIMETRICis defined. -
FASTLED_RGBW_COLORIMETRICcompile gate exists, off by default. - With the gate undefined, selecting
kRGBWColorimetricorkRGBWColorimetricBoosteddispatches to a stub that callsFL_WARN_ONCE(...)with the message specified in Opt-in gating and then falls back torgb_2_rgbw_exact. Does not pull in the float / simplex / profile machinery. -
FASTLED_SUPPRESS_COLORIMETRIC_FALLBACK_WARNINGcompile flag silences the warn-once without disabling the fallback behavior. - With
FASTLED_RGBW_COLORIMETRICundefined, a release build's binary size is within a small documented delta of currentmasterfor at least one small MCU target (e.g. AVR, ESP32-C3) — the only additions are the stub function and warn-once flag storage. -
Rgbw::white_color_temp(currently unused) actually positions the W vertex in CIE xy for the new modes. -
fl::DiodeProfile { xy_r, xy_g, xy_b, xy_w, lum_r, lum_g, lum_b, lum_w }(or equivalent) struct exists with at least one built-in default (SK6812 RGBW3535) and a public setter for user-supplied profiles. - The simplex solver (xyY↔XYZ, 2D barycentric, 3D XYZ solve, brightness normalize) is implemented once and shared between modes — explicit non-goal to duplicate this primitive.
- Unit tests cover: pure primaries, secondaries (incl. Sonia's cyan input → expected RGBW), D65 white, low-saturation pastels, and an out-of-hull projection case. Tolerances expressed in dE against the math-model reference output. Tests compile only when
FASTLED_RGBW_COLORIMETRICis defined. - Per-pixel cost of
kRGBWColorimetricandkRGBWColorimetricBoosteddocumented in cycles or µs on a reference target (ESP32-S3, AVR). - Documentation explains: when to pick which mode, what diode-profile data the user needs, the brightness/color-accuracy tradeoff, and how to enable the modes via
FASTLED_RGBW_COLORIMETRIC. - Existing modes (
kRGBWExactColors, etc.) and their output values are byte-for-byte unchanged.
Decisions
- Priority: P3 — quality-of-life improvement for a specific user category (RGBW + color-accuracy-sensitive use cases like ambilight). No regression in existing functionality.
- Mode naming:
Colorimetricfamily —kRGBWColorimetric(strict_subgamut) andkRGBWColorimetricBoosted(wx_lp_legacy). "Colorimetric" is the term-of-art for physically-accurate color math; signals "real math, not RGB tricks" via terminology rather than via a warning comment. Confirmed via question; alternatives considered:GamutMapped,SubGamut,Calibrated. - Compile-time opt-in:
FASTLED_RGBW_COLORIMETRIC— off by default. The new path is intrinsically float + profile data and should not land in the binary unless explicitly requested. Matches the issue [Tracking] Break unwanted cross-TU references that drag optional subsystems into all builds (follow-up to #2421) #2424 binary-bloat mitigation pattern already inrgbw.cpp.hpp. Confirmed via question. - Scope: opt-in via
RGBW_MODE, not a default change — existing modes and their byte-for-byte output unchanged. Avoids surprising users whose tuning depends on residual-subtract math. - Land strict_subgamut + wx_lp_legacy first — strict gives the color-accurate floor; wx_lp_legacy is a closed-form scalar LP (gist §9) that maximizes W cheaply. Together they bracket the accuracy/brightness tradeoff with minimal code.
wx_radial_virtualandwx_virtual_axis_maxbrightcan come later behind the sameDiodeProfileAPI and the same compile flag. - Runtime solvers before LUTs — Phase 1 avoids the LUT memory/storage question entirely and produces deterministic output for tests. Add LUT path only if profiling shows the per-pixel solve is too costly for target frame rates.
- Naive 3D vertex_tetra cube is rejected as the LUT shape — at 17³ it costs 39 KB and at 9³ it's too lossy. If a LUT is ever needed, ship the 2D chromaticity LUT + 1D brightness ramp factorization described in Memory footprint and LUT compaction. The math factors that way naturally (sub-gamut selection depends only on
xy; brightness is a separate linear scale per sub-gamut), so a 3D cube wastes storage on a degenerate dimension. Factored sizing: 1.4 KB (16×16 grid) to 16.4 KB (64×64 grid). - LUT path gets its own compile flag —
FASTLED_RGBW_COLORIMETRIC_LUT, separate fromFASTLED_RGBW_COLORIMETRIC. Users who opt into colorimetric should not automatically pay LUT storage; the LUT is for projects with the headroom and the per-pixel cost concern. white_color_tempsemantics: feed into W vertex selection — repurpose the field that currently exists-but-does-nothing, so existing user CCT settings actually have an effect under the new modes.- Diode profile: measured ratios preferred, datasheet wavelength→xy fallback acceptable — ship SK6812 RGBW3535 as the first profile; user-supplied profiles override.
- Builder/verifier projection parity — gist §3 is explicit that both must use the same out-of-hull projection. Tests should fail if projection diverges from the math-model implementation.
- Reference-code licensing: defer vendoring — clean-room reimplement from the math-model gist. The Python
xy_target_rgbw.pyis a cross-check oracle for tests, not a code source.
Future direction (gist §14)
Strict sub-gamut and WX are slices of a larger physical-solution space. A future policy axis could let one input RGB target address multiple valid physical RGBW solutions via:
- two or three 3D LUTs + runtime blend coefficient
- base cube + WX delta cube
- sparse 4D LUT with a small mode-axis grid
This is post-Phase 3 exploration. Worth keeping in mind for the API shape so we don't paint into a corner.
Related issues
- RGB to RGBW #106 — generic "how do I use RGBW" (predates current RGBW support; not a duplicate of this algorithmic improvement).
- Add RGBW support to the LED driver code (tracking Issue) #1540 — closed tracking issue for original RGBW driver support. This proposal builds on top of that work.
- [RGBW] Add method to dynamically manage the white channel #2146 — closed; dynamic white-channel management API. Adjacent but orthogonal.
Out of scope for this issue
- Per-pixel runtime CCT switching.
- Auto-calibration tooling (would require colorimeter integration; user-supplied profile data is the contract).
- Layered multi-emitter solves for >4 emitters — track in a follow-up once 4-channel lands.
- Wave/TemporalBFI integration — orthogonal to the RGBW conversion math.
Activity
feat(rgbw): colorimetric RGB->RGBW solvers + LUT + CCT + RGBCCT (#2545)
feat(rgbw): colorimetric RGB->RGBW solvers + LUT + CCT + RGBCCT (#2545)
feat(rgbw): colorimetric RGB->RGBW solvers + LUT + CCT + RGBCCT (#2545)
feat(rgbw): colorimetric RGB->RGBW solvers + LUT + CCT + RGBCCT (#2545)
feat(rgbw): colorimetric RGB->RGBW solvers + LUT + CCT + RGBCCT (#2545)
perf(parlio): #2548 pipe4 — 4-position pipelining (+41% vs baseline, …
perf(parlio): #2548 BF1 — chipset-aware direct encode (5.5× vs baseli…
perf(parlio): #2548 extend BF1 chipset-aware encode to 2/4/8-lane Wav…
zackees commentedon May 31, 2026
Closing as completed. Colorimetric RGBW path delivered by PR #2552:
kRGBWColorimetric/kRGBWColorimetricBoosteddispatch in src/fl/gfx/rgbw.h and full solver in src/fl/gfx/rgbw_colorimetric.{h,cpp.hpp}. Follow-up RGBWW (5-channel) tracked in #2558 (also merged).fix(rgbw): source RGB color space + differentiated boosted solver + H…
feat(lint): enforce Public Settings Pattern for fl:: global setters (…
feat(lint): enforce Public Settings Pattern for fl:: global setters (…
docs(cpp): enforce Public Settings Pattern for global setters (#2715)