Skip to content

RGBW FastLED Implementation Divergences, bug report, & proposed fixes with pseudocode #2748

Description

@JChalka

Board / MCU

Other

LED Chipset

WS2812B / NeoPixel

FastLED Version

git master

Arduino / PlatformIO version

PIOArduio 1.4.4

Operating System

Windows

Description

Creating an issue to mirror the feedback provided within the original reddit post describing the model & our followup conversations, relevant recent bits from reddit :

"bit of an update:
the LP solver within FastLED now is mostly just white channel usage with almost 0 RGB involvement on White-like values. The actual algorithm as you currently have implemented seems to have diverged quite a bit from the original math model implementation : https://gist.github.com/JChalka/915603d7930b7216d5c5aae834ec2ea9#9-reference-wx-mode-wx_lp_legacy

quick verifier session (36 samples) : https://docs.google.com/spreadsheets/d/1IwOEJ_shMiYU1MPdZpvGLIUXNmY3tPXj8nfiHJAZkX0/edit?usp=sharing

The good news:

  • LP solver & sub-gamut are no longer 1:1 outputs
  • sub-gamut is now target white point aware and it works, verifier was able to capture passing dE white points with equal RGB components for the input at the default D65 white point
  • Dual channels mostly look better as far as Y ratio scaling is concerned, there is some issues noted below that are different than that failure mode

the bad news:

  • the LP solver is no longer working as a chromaticity aware solver and is just shoving in white and removing residuals which is contradictory to its actual goals as a solver and is no longer following the math model implementation as much as it can

  • the sub-gamut solver is now failing single-channel topology rules within the native-gamut, which given the failure type shown could probably spill into named-gamuts. There are quite a few cases where we have illegal topology in play despite "fl::set_input_gamut(&testBenchRgbwProfile, fl::InputGamut::Native);" so things like single channel & dual-channel/Edge authority should stick.

  • Dual-channels like yellow_half aren't being properly scaled down to their appropriate output drive levels, yellow_half for example is basically the same output RGBW tuple as full yellow which means there is no "half" it's just always full yellow

the sub-gamut model has strict legal topologies while addressing the native gamut:

black
R, G, B, W
RG, RB, BG
RW, GW, BW
RGW, RBW, BGW

This means in native-gamut mode single channel authority should always be present, 0, 0, 65535 should never pull in R or G for example and full channel budget should be allowed. As shown in the quick verifier session pure Greens currently pull in about ~half of it's q16 budget on white as well which is illegal topology within the struct sub-gamut model

this pull-in is also present in values like Cyan, red_half, green_half, cyan_half, magenta_half, spring, azure, violet, & dark_green. In the native_gamut these should basically all be authoritative Single channel or Dual channel solves not a triangle solve that somehow manages to bring in white, the fix shouldn't probably involve a post-solve channel strip either as that would mask problems within the algorithm as implemented that would allow illegal topologies and then named-gamuts would still be able to allow the illegal topologies instead of following the strict sub-gamut rules and then projecting to the named-gamuts hull

bit of another note :
in rgbww.cpp.hpp around line 208 : const colorimetric_detail::DiodeProfile& wp = profile.warm_path; causes a compile-time error when the colorimetric path is enabled via the flag, fixed via const fl::DiodeProfile& wp = profile.warm_path; (PR already created to fix this one)

edit: I'm running a larger verification session currently which is exposing a couple more bugs that affect 3-channel input solves (it's mostly just granularity issues following similar trends as yellow_half) I'll report back with that medium-run CSV when it finishes up"

"Following up with the medium patch set report : https://docs.google.com/spreadsheets/d/1GYxE3jcknTTUx9mYUp4wGJd8SEkBKI-sdCajryqsx6U/edit?usp=sharing

Exposes a bit more issues than the quick patch-set did, although the issues flagged from that still apply.

h180_s100_v015 0 9830 9830 | 0 24029 65535 38635

h180_s100_v035 0 22937 22937 | 0 24029 65535 38635

h180_s100_v055 0 36044 36044 | 0 24029 65535 38635

h180_s100_v075 0 49151 49151 | 0 24029 65535 38635

Dual-channels are the biggest failures where it pulls in an unrelated third channel in sub-gamut mode + there is no granularity, every solve is essentially pegged to its max Y solve regardless of the input RGB tuple.

h000_s060_v015 9830 3932 3932 | 18610 0 932 3826

h000_s060_v035 22937 9175 9175 | 43422 0 2175 8927

h000_s060_v055 36044 14418 14418 | 65535 0 3283 13474

h000_s060_v075 49151 19661 19661 | 65535 0 3283 13474

h000_s060_v100 65535 26214 26214 | 65535 0 3283 13473

this is also present in some, but not all, 3 channel solves where inputs get clipped partway through and then are never allowed to be fully granular which compresses the high end and leaves mostly low-end"

I attached a more detailed README/report comparing the current FastLED RGBW colorimetric implementation against the current reference math model and verifier outputs.

The main goal here is not to move FastLED toward baked 3D LUTs. The Python math model is currently performing very well, and FastLED already has most of the right building blocks for a fast analytical runtime path: profile caching, source-space matrices, cached sub-gamut inverses, and W-displacement math.

The report focuses on the current divergences:

  1. Native single-channel and native outer-edge topology authority are not currently preserved.
  2. Some HSV/value ramps collapse multiple input values to the same RGBW output, suggesting value is being lost after a full-chroma/endpoint solve.
  3. The current boosted W overdrive behavior is useful, but it should be separated from the reference wx_lp_legacy behavior, which is a chromaticity-preserving max-feasible-W endpoint.

The README includes concrete failing verifier rows, FastLED-vs-cube overlap data, source/model snippets, and proposed C++-style pseudocode for fixing the solver while keeping the runtime path analytical and MCU-friendly.

Steps to reproduce

FASTLED_RGBW_COLORIMETRIC_DIVERGENCE_README.md

Minimal sketch

Serial / debug output

Checklist

  • I have searched existing issues for duplicates
  • I have tested with the latest FastLED release or git master
  • I can reproduce this with a minimal sketch

Activity

  1. added
    status: triage
    type: bug
    on Jun 4, 2026
  2. moved this from Triage to Done in FastLED Trackeron Jun 4, 2026
  3. JChalka commented on Jun 4, 2026

    @JChalka
    ContributorAuthor

    Thanks for the update here — this latest commit definitely fixed one important part of the previous report.

    The native single/dual illegal-topology issue is mostly addressed now: in the stopped-early verifier subset I’m seeing 0 illegal native single/dual outputs, where the previous run had W/third-channel bleed on single and dual native edges. Pure red/green/blue and half red/green/blue now correctly stay on their native channel, which is a good improvement.

    The remaining issue is that the native topology guard currently treats both single-channel and dual-channel inputs as direct passthrough:

    if (n_active <= 2) {
        out_rgbw[0] = clamp(s_r);
        out_rgbw[1] = clamp(s_g);
        out_rgbw[2] = clamp(s_b);
        out_rgbw[3] = 0;
        return true;
    }

    That is correct for single-channel native identity, but not for dual-channel native edges.

    The rule we need is:

    native single channel:
        exact 1:1 passthrough is correct
    
    native dual edge:
        lock the active channel set to RG / RB / GB,
        but still solve the two active emitters from target XYZ
        This also applies to direct GW / RW/ BW solves which should not be classified as 3-channel solves, but boundary solves that exist within the overall LED gamut
    

    So yellow_half should not pull in B or W, but it also should not return 32768,32768,0,0. With the current reference model/ramp path, the expected shape is closer to:

    yellow_half   32768,32768,0 -> ~32419,16813,0,0
    magenta_half  32768,0,32768 -> ~32450,0,9753,0
    cyan_half     0,32768,32768 -> ~0,32754,19228,0
    

    The latest verifier shows the current passthrough behavior failing hard:

    yellow_half   latest: 32768,32768,0,0   dE 58.05
    yellow        latest: 65535,65535,0,0   dE 54.35
    orange        latest: 65535,32768,0,0   dE 52.24
    cyan_half     latest: 0,32768,32768,0   dE 48.23
    magenta_half  latest: 32768,0,32768,0   dE 83.48
    

    What needs to be implemented is a fixed-topology dual solve:

    if (is_native_input_gamut(*cache.profile)) {
        int n = count_active_channels(s_r, s_g, s_b);
    
        if (n == 1) {
            // exact single-axis identity
            out_rgbw[0] = clamp01(s_r);
            out_rgbw[1] = clamp01(s_g);
            out_rgbw[2] = clamp01(s_b);
            out_rgbw[3] = 0;
            return true;
        }
    
        if (n == 2) {
            // same active RGB channels only, but solve from XYZ
            return solve_native_dual_edge(cache, s_r, s_g, s_b, out_rgbw);
        }
    }

    The dual edge helper should solve only the active two columns:

    static bool solve_native_dual_edge(const ProfileCache& cache,
                                       float s_r, float s_g, float s_b,
                                       float out[4]) {
        out[0] = out[1] = out[2] = out[3] = 0;
    
        float value = max3(s_r, s_g, s_b);
        if (value <= EPS) return true;
    
        float chroma[3] = {
            s_r / value,
            s_g / value,
            s_b / value,
        };
    
        float X_full[3];
        if (cache.has_source_space) {
            matvec3(cache.M_src, chroma, X_full);
        } else {
            X_full[0] = cache.P_R[0] * chroma[0]
                      + cache.P_G[0] * chroma[1]
                      + cache.P_B[0] * chroma[2];
            X_full[1] = cache.P_R[1] * chroma[0]
                      + cache.P_G[1] * chroma[1]
                      + cache.P_B[1] * chroma[2];
            X_full[2] = cache.P_R[2] * chroma[0]
                      + cache.P_G[2] * chroma[1]
                      + cache.P_B[2] * chroma[2];
        }
    
        int active[2];
        int count = 0;
        if (s_r > EPS) active[count++] = 0;
        if (s_g > EPS) active[count++] = 1;
        if (s_b > EPS) active[count++] = 2;
    
        float full[4] = {0,0,0,0};
        solve_fixed_topology_least_squares(cache, X_full, active, 2, full);
        normalize_if_needed(full);
    
        out[0] = full[0] * value;
        out[1] = full[1] * value;
        out[2] = full[2] * value;
        out[3] = 0;
        return true;
    }

    The second remaining issue is value granularity for 3-channel/interior solves. The current path still appears to solve the value-scaled RGB input directly, then normalize if a channel exceeds 1.0. That causes different value levels to collapse into the same output.

    Current examples:

    h000_s060_v055 -> 65535,0,3283,13474
    h000_s060_v075 -> 65535,0,3283,13474
    
    h000_s085_v055 -> 65535,0,879,3606
    h000_s085_v075 -> 65535,0,879,3606
    h000_s085_v100 -> 65535,0,879,3606
    

    The strict solver should instead do the same chroma/value split as the reference model:

    float value = max3(s_r, s_g, s_b);
    float c_r = s_r / value;
    float c_g = s_g / value;
    float c_b = s_b / value;
    
    float full[4];
    solve_strict_subgamut_full_chroma(cache, c_r, c_g, c_b, full);
    
    out[0] = full[0] * value;
    out[1] = full[1] * value;
    out[2] = full[2] * value;
    out[3] = full[3] * value;

    Projection and normalization should happen on the full-chroma endpoint, not on the already value-scaled input node. Otherwise v055, v075, and v100 can all normalize into the same tuple.

    The third remaining item is the LP solver. solve_wx_overdrive() is useful as a boosted/drift mode, but it is not the reference wx_lp_legacy solver. wx_lp_legacy should be restored as its own mode:

    a = P_RGB_inv * X_t;
    d = P_RGB_inv * P_W;
    
    w = 1;
    for each RGB component i:
        if (d[i] > EPS && a[i] >= 0)
            w = min(w, a[i] / d[i]);
    
    rgb = max(a - w*d, 0);
    f = normalize_if_needed([rgb.R, rgb.G, rgb.B, w]);

    Then the modes can remain cleanly separated:

    strict_subgamut       -> strict topology solve
    wx_lp_legacy          -> max feasible W, chromaticity preserving
    boosted / overdrive   -> intentional W drift, separate visual policy
    

    So the direct implementation asks are:

    1. Split native single and native dual handling.
    2. Keep single-channel native inputs as exact identity.
    3. Replace dual-channel passthrough with a fixed-topology two-emitter XYZ solve.
    4. Add chroma/value separation to strict 3-channel/interior solves.
    5. Apply projection and normalization to the full-chroma endpoint before value scaling.
    6. Restore wx_lp_legacy separately from solve_wx_overdrive().
    7. Add regression tests for dual-edge non-identity, HSV value-ramp monotonicity, and LP-vs-boosted separation.

    This still keeps the FastLED path analytical and MCU-friendly. No baked 3D LUT is required.

    Suggested remaining fixes for sub-gamut model :
    FASTLED_RGBW_COLORIMETRIC_FOLLOWUP_REQUIRED_FIXES.md

    Suggested remaining fixes for LP Solver + Comparison report:
    FASTLED_LP_LEGACY_CUBE_COMPARISON_REPORT.md

  4. JChalka commented on Jun 4, 2026

    @JChalka
    ContributorAuthor
    Image

    I should have a PR ready soon, I want this medium run to finish up first though in case I missed something in my patch

  5. moved this from Done to Triage in FastLED Trackeron Jun 10, 2026
  6. zackees commented on Jun 10, 2026

    @zackees
    Member

    Seeing this on review, i'm opening it back up for further review and will close when done

  7. JChalka commented on Jun 10, 2026

    @JChalka
    ContributorAuthor

    @zackees #2752 fixed that up, so things are aligned now and looking sane

  8. zackees commented on Jun 10, 2026

    @zackees
    Member

    Awesome glad to hear. Final question how does your formula handle the fact that green is so much more perceptually visible? we have basic color adjustment for that. Have you looked into if we are doing it wrong?

  9. 4 remaining items

  10. zackees commented on Jun 10, 2026

    @zackees
    Member

    fair enough. Thanks again.

  11. JChalka commented on Jun 10, 2026

    @JChalka
    ContributorAuthor

    No problem, glad to be able to contribute something after years of using FastLED!

    I've got one more PR en-route in regards to the sub-gamut model as implemented:
    Opt-out patch that ensures channels scale appropriately according to the input RGB values.
    Basically the current sub-gamut model (other models already have proper endpoint scaling) allows output values such as this:

    h315_s015_v100 RGB input= 65535/55705/63077 RGBW sub-gamut output: 35438/0/20984/55705
    

    so it pretty much goes "input RGB -> White extraction energy split -> scale channels based on the split channel energy from the input, not the actual input". Can see that W is set to 55705 instead of 65535 so the 'problem' is deterministic

    post-fix output would look somewhat close to (given my wall-measured RGBW primary xyY values)

    roughly: 41695 / 0 / 24691 / 65535
    

    instead.

    I've already got the fix implemented in my local fork I just want to run the verifier before I push the PR to ensure it landed right, if you want I can also work towards splitting the core solver logic away from a strict "white extraction" sense such that it could be applied to RGB as well. Overall I think this would be a nice clean split as then the actual solver work could just get moved into a "colorimetric_response.cpp.hpp" and then RGB/RGBW/Future 5 channel+ chipsets source/header files could just pull in the few functions it needs to actually solve the values and then the colorimetric_response source becomes the consolidated area for the actual math model implementations.

    probably not something I'd implement today, would like to get an RGB test bench setup first and I've got some other things IRL I need to take care of, but the plumbing is pretty much all there so the hard work is basically done for that.

  12. zackees commented on Jun 11, 2026

    @zackees
    Member

    Please yes, that would be awesome. Just a reminder that the acceptance criteria is that the algorithm compresses well into a discrete form

  13. JChalka commented on Jun 13, 2026

    @JChalka
    ContributorAuthor

    RGB algo should be a bit less than the current sub-gamut implementation so that should be pretty easy, things like the LP overdrive solver aren't really applicable toward it since there's no inner channel.

    I'll probably implement this in a few different phases that way it's not just an all-in-one sweep.
    Probably something like:
    Phase 1) Implement RGBW Sub-gamut endpoint scaling as implemented in my local fork (this is already on my forked repo but has not been tested, been a bit busy)
    Phase 2) split portable functions from RGBW_Colorimetric into colorimetric_response.cpp.hpp/.h
    Phase 3) implement RGB_colorimetric.cpp.hpp/.h
    Phase 4) find good implementation points for rgb_colorimetric - This is the bit that I haven't actually looked too deep into yet (aka "where is the best entry point?")

    Overall I think both RGB/RGBW colorimetric should continue to be an opt-in rather than an opt-out so I don't want to go replacing the current/legacy functions (or break old code) so the final implementation will probably still keep the compile-time gating, although I'll probably look into runtime enabling/disabling as well so that things mesh well with the newly implemented Channels API. The explicit compile-time enable/disable is good for maintaining binary sizes on hardware that can't exactly support this due to memory constraints though.

    Expect Phase 1 sometime within the next few days, it's already been implemented on my end I've just got some stuff going on around the house so I haven't exactly got around to running the verification session to make sure it looks sane

  14. moved this from Done to Triage in FastLED Trackeron Jun 13, 2026
  15. zackees commented on Jun 18, 2026

    @zackees
    Member

    Coming back on this now. You'll start seeing this addressed.

    I want to really push the envelop on this color computation. Right now we are on theoretical math. From experience theory is great but hardware has all kinds of quirks. The machine AI can get this 99% perfect if the following is true:

    • It has a hardware feedback loop

    That's the only thing missing from this equation right now.

    What you should know is that I have an entire feedback loop so the AI can get the calculations to as close to ideal within the constraints as we want. The AI jargon term is "auto research" and if you look at the FastLED repo I have implemented this AI pattern directly into the project.

    Infact, this is how I'm programming drivers now for LEDs.

    I'd like to apply "auto research" and harden your algorithm by throwing it "into battle" on RGBW strips.

    There's two options I'd like you to consider, either is fine.

    1. I do it all, and I ping with the results. -or-
    2. I teach you how to use FastLED's auto research tool and then you continue the color feature.

    If you choose (2) here's how it benefits you:

    • No one has done auto-research on an embedded project like this before. You would going to learn a frontier AI development strategy. You of course are welcome to copy this strategy in your own work, I claim no ownership over my implementation.
    • Use auto research is dead simple, all the hard parts have been figured out. I'll give you one prompt with the AI and you'll "get it".
    • Anything you want to implement in hardware can now be done automatically. This is literally a super weapon and you'll be ahead of your peers. You don't even have to share your innovation back, though I'd appreciate any innovation that you want to upstream. FastLED auto research can be your private tool for all tricky hardware stuff.

    What this auto research work flow would look is this:

    • Get a high precision color probe
    • Write a device driver for it (trivial)
    • Glue it on to an RGBW strip
    • Open up Claude/Codex/whatever in the fastled repo and tell it "use auto research to measure the color correction for RGBW. You have an WS2812 RGBW strip. If there are gaps in the driver/rpc-binding, fix them so that RGBW loopback for color correction works. Then run the auto research on this and report back to me the accuracy of the calculation vs the measured effects, make sure that it's adjust for human eye-color response".

    Like I said, I'm perfectly happy to do all of this. This is just me the opportunity to level you up like you've level this project up.

    You don't have to make a decision right away, just think about it and let me know at your convenience. I'll make sure to put attribution to your satisfaction so that everyone knows that the color correction came from your efforts and all credit goes to you.

  16. zackees commented on Jun 18, 2026

    @zackees
    Member

    Follow-up tracking has been split out into #3231.

    That new meta issue covers the remaining post-#2752 work from this thread:

    • RGBW sub-gamut endpoint scaling for cases like h315_s015_v100, where output appears scaled from white-extraction split energy rather than the actual input endpoint/value.
    • Shared colorimetric_response plumbing and an opt-in RGB colorimetric path, while keeping RGB/RGBW behavior gated and discrete-form friendly.

    The original #2748 items fixed by #2749 and #2752 can stay documented here; the remaining work should continue in #3231.

  17. JChalka commented on Jun 18, 2026

    @JChalka
    ContributorAuthor

    Bit of an update, Phase 1 is essentially almost complete. I'm waiting on a final verification pass to finish up on that and then I'll be moving onto phase 2 (aka the shared-function split to colorimetric_response)

    phase 3 has slightly shifted in scope as technically the current RGBCCT/W+W implementation within FastLED is an overdrive model, not a strict sub-gamut solve. so I'm going to go ahead and make sure that phase 3 also lands the RGBCCT efficient strict sub-gamut model.

    The RGBCCT/W+W strict sub-gamut solve does have a bit of ambiguity where one side of the triangle doesn't contain obvious efficient solves. in a cool white + warm white setup this ends up being the RB side of the triangle where there is an overlap between RB+WW & RB+CW where either solve could be valid, the GR & GB sides are where the Warm White & Cool White diodes lean towards so there is an obvious efficient inner-emitter solve and it doesn't have the same ambiguity/overlap. There's a few directions I've laid out for how this could be looked at but I still need to work out which path would essentially be "most efficient", ideally the boundary for RB+WW or RB+CW would be a cached decision so that way there's no added runtime complexity between strict sub-gamut RGBW and strict sub-gamut RGBCCT/W+W, I may need to actually get some of these WS2805 RGBCCT strips to actually verify some of these CCT models against. Even if we can mathematically come up with an efficient boundary approach we don't want the brightness/ Y/nits to shift dramatically across the boundary and produce odd results. RGBCCT is essentially experimental until it can be physically verified against, even if the may be math sound.

    I did recently order a spectrophotometer to play around with so I'll be able to build a spectral correction matrix for my colorimeter soon and we should be able to parse some more accurate xyY & dE checks and see how the wall is actually influencing the LED output/reflection. This is especially useful for profiling different chipset/led types and should help keep measured xyY more accurate. Doesn't mean much for the algorithm itself but this does make verification dE/dY checks more sane in that the measured data should be much more accurate after the spectral correction.

    still have ~1000 patches left to check on phase 1 and then I might finish up phase 2/3 today or tomorrow. Phase 3 is split between RGB & RGBCCT so the RGB-only (and RGB within RGBW strip solve by extension for compatibility, aka RGB only solve but output to RGBW strip) path will almost certainly land first (without the final FastLED hook-in, as that point still needs to be determined) with the RGBCCT path landing a bit later due to it being a bit more nuanced.

    As far as the RGB solve entrypoint goes this is a bit of an interesting one as the RGB pipeline within FastLED is different depending on the chipset/end device. The colorimetric solve essentially resembles a 3DLUT in that once values pass through the colorimetric solve they cannot be mutated/manipulated. This means any gamma correction or power scaling needs to happen before it enters the colorimetric path, and we don't want any other color tempearture settings or such manipulating the pre-solved values (gamma correction before Solve is the correct way to handle Gamma/Transfer curve, along with power management work). Once the colorimetric path has solved its values they cannot be changed for any reason whatsoever; doing so would mean the post-solve mutated values are no longer "correct" and should shift their chromaticity. So the RGB solve entrypoint within the FastLED RGB-Only pipeline needs to be in a spot where it can output to all available chipsets but have any power scaling or gamma/transfer application made before the solve.

  18. zackees commented on Jun 18, 2026

    @zackees
    Member

    Split out the shared colorimetric response layer + RGB colorimetric entrypoint design into #3242 so this can be planned independently from the remaining RGBW endpoint-scaling/verifier work.

  19. zackees commented on Jun 28, 2026

    @zackees
    Member

    @JChalka Thank you, sonia, for originating the RGBW colorimetric work and for the math-model discussion, verifier material, and roadmap that shaped this implementation.

    I pushed the current profile-backed API in draft PR #3435. The full sketch is here:
    https://github.com/FastLED/FastLED/blob/codex/rgbw-colorimetric-codec/examples/RGBWColorimetric/RGBWColorimetric.ino

    Inline example of the new API shape:

    #ifndef FASTLED_RGBW_COLORIMETRIC
    #define FASTLED_RGBW_COLORIMETRIC 1
    #endif
    
    #include <FastLED.h>
    
    #define DATA_PIN 3
    #define LED_TYPE SK6812
    #define COLOR_ORDER GRB
    #define NUM_LEDS 60
    #define BRIGHTNESS 128
    
    CRGB leds[NUM_LEDS];
    
    void setup() {
        Serial.begin(115200);
    
        fl::shared_ptr<const fl::color::DiodeProfile> profile =
            fl::color::make_diode_profile(fl::color::kRgbwDefaultProfile);
    
        fl::Rgbw rgbw(
            fl::kRGBWDefaultColorTemp,
            fl::RGBW_MODE::kRGBWColorimetric,
            fl::EOrderW::W3,
            profile);
    
        FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS)
            .setCorrection(TypicalLEDStrip)
            .setRgbw(rgbw);
    
        FastLED.setBrightness(BRIGHTNESS);
    }
    
    void loop() {
        const uint32_t now = millis();
    
        for (int i = 0; i < NUM_LEDS; ++i) {
            const uint8_t wave = sin8((i * 255 / NUM_LEDS) + (now / 8));
    
            if (i < NUM_LEDS / 3) {
                leds[i] = CHSV(wave, 255, 255);
            } else if (i < (2 * NUM_LEDS) / 3) {
                leds[i] = CRGB(wave, wave, wave);
            } else {
                const uint8_t g = 120 + ((uint16_t)wave * 80 / 255);
                const uint8_t b = 40 + ((uint16_t)wave * 80 / 255);
                leds[i] = CRGB(255, g, b);
            }
        }
    
        FastLED.show();
        FastLED.delay(1000 / 60);
    }

    The key part is that the measured profile lives with the fl::Rgbw config via fl::shared_ptr<const fl::color::DiodeProfile>, so users can enable the colorimetric path with .setRgbw(rgbw) without managing a raw profile pointer.

  20. zackees commented on Jun 28, 2026

    @zackees
    Member

    Closing after pushing the current RGBW colorimetric codec/profile API and example in draft PR #3435: #3435

  21. moved this from Triage to Done in FastLED Trackeron Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: triagetype: bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions