Is it possible to adjust the brightness of just a few leds on a strip independent from the global brightness value? I’m incorporating some fiber optic wire into a wearable matrix and the brighter the led it is attached to the better it works. I have the wire hooked up to just a few pixels and would prefer to keep the rest of the pixels at a lower brightness.
@Daniel_Cikic I’ve never used subtractFromRGB before, but I think it subtracts a constant value from each channel, which could change the look of the colour.
For example, CRGB(50, 255, 255).subtractFromRGB(50) would return 0,205,205, which has no red in it.
@Chris_Parton You’re right. For correct colors he’d probably have to do a hsv conversion. But for changes to a certain degree I don’t think this is really a problem. And somebody put this function in there for a reason.
But maybe Steve is using HSV already, who knows…? ^^
Edit: Just saw this one the first time… should look at that page more often.
// Adjust brightness to maximum possible while keeping the same hue.
leds[i].maximizeBrightness();
Maybe this would be useful on the leds used with fiber optics?
@Daniel_Cikic I agree, I think for lots of colours and reduction values the two methods would yield a similar result. I didn’t know that method existed, so thanks for introducing it to me
Hey guys! Sorry it took so long to get back. I tried a few of the methods suggested without any luck and got distracted by other projects. I decided to take another crack at it today and found exactly what I was looking for.
Using demoreel100 as an example, i set #define BRIGHTNESS 255 #define NUM_LEDS 12
and then in the loop() i put fadetoblackby() just before FastLED.show like so:
fadeToBlackBy( leds, 10, 240);
FastLED.show();
This is exactly the effect I was looking for! It causes the first 10 leds to be very dim and the last 2 leds to be at max brightness.
@Ken_White Can one somehow also only change the brightness (the “v” part of HSV, if one wants to keep hue and saturation as they are (I write to the entire leds array from palettes and only want to darken/brighten random LEDs)? Something equivalent to:
leds[i] = CHSV(as is, as is, change V up/down);
The thing is that leds[i].addToRGB(20); can overshoot 255 and then all colour information is irretrievably lost.