Question:  Does fill_gradient (and fill_gradient_RGB) force the master brightness to full 255?

Question: Does fill_gradient (and fill_gradient_RGB) force the master brightness to full 255?
Here’s what I’m running into-- I set the master brightness very low in setup: FastLED.setBrightness(15);
When the sketch is uploaded, the very first time through the main loop it uses this set master brightness, BUT ONLY UNTIL a fill_gradient is used. Then it seems like the master brightness is set to 255 from then on.

My test sketch:
http://pastebin.com/Q9b1XqYN

I’m running current FastLED library, Teensy 3.0, LPD8806 strip, and Arduino v1.6.5.

CHSV works differently than CRGB in this case. The wiki details it, but every call where you return a CHSV is effectively setting the brightness to full.

Thanks Peter. Can you point me to what you’re referring to in the wiki, I’m not finding it.

Here’s another simple test example.
http://pastebin.com/sY6e0iiE

After uploading the code, the very first time through the main loop the leds will be filled with a low brightness red and then a higher brightness red. The second and subsequent times through the main loop it will only display at the higher brightness.

If the code is uploaded again it will display the lower brightness then higher brightness the first time though, and then only display the higher brightness after that again.

I’m trying to understand why this happens. Why is master brightness not being applied on second and subsequent times through the main loop?

Some notes. CHSV is hue, which is effectively the color, saturation, or how much of the color, and value, which is how bright the color will be. It’s very clearly not CRGB which is just red, green, and blue mixed to create a color and then managed by FastLED to obtain the desired brightness values in a CRGB container. In your case, setBrightness() will always lose to a v value because it must respect what you are doing with the CHSV container. In your code, the setBrightness has no real impact at all.

Functionally, even though it is always RGB (or BGR, or GBR, etc) in the HW, FastLED buys you a lot of flexibility by managing how it sets the r, g, and b in the back, and giving you access to a lot of ways to get the look you want. CHSV is just a fancy way of managing the color in a way that provides a flexibility that RGB can’t do as well.

If you want to use CHSV, use the HSV colors from the second link above, and then modify v as needed to achieve your brightness.

And I know my three examples for HSV are imperfect, but was trying to make it quickly understandable, and will defer to documentation for a more complete/accurate explanation.

Strange issue, not sure what would be causing it. Setting the brightness should scale all colors the same, whether they’re RGB or HSV, right? If you have your brightness set to 16 and set an LED to CHSV(0, 255, 255), I would expect a dim red, just as you’d get if you set it to CRGB(255, 0, 0).

Yes, that’s why this puzzles me. Master brightness is scaling brightness down the very first time through the main loop, until it gets to fill_gradient, but then seems to be ignored after that.

This really is a Daniel Garcia question (sorry, I can never find you using +). I thought that brightness didn’t impact directly CHSV operations, but I may be wrong.

If I comment out the master brightness setting in setup:
//FastLED.setBrightness(15);

And then manually specify the brightness on with FastLED.show(15); it loops with brightnesses as I would expect. But I’m am still puzzled about my first two examples.