Linear Blend from pink to blue

Hi,

I am new to using the RGB leds and was trying to blend linearly along a strip of RGB LEDs with WS2812 chipset. I want to blend from dark pink to dark blue color and move back and forth through the strip. I have tried just adding colors to the each leds but the transition does look smooth. I have gone through some of the example codes provided in FASTLED library but couldnt find what I needed. Is there any other example code which would help me achieve this?

Thank you in advance.

The RGB color system is not very useful for blending colors smoothly.

It is usually much easier to transform the color system to HSL or HSV (Hue, Saturation and Value), then you tweak the hue and produce a series of transformed RGB values.

Start here: HSL and HSV - Wikipedia

C/C++ functions are available to do the transformations.

However, for two arbitrary sets of RGB values, it is straightforward to produce a linear gradient as described here. It may not look "natural": Code - heatmaps and color gradients - NoskeWiki

Thank you for this will take a look at it. I used the CHSV functionality and the colors seemed to be better. Is there a way to get a smoother transition when the color moves from one LED to another?
Right now I am using a for loop and the color transitioning does not look smooth.

Please post the code, using code tags.

a smoother transition when the color moves from one LED to another

What does this mean? Explain what you have in mind for a "smooth transition".

This may help you:
https://arduinoplusplus.wordpress.com/2020/06/11/neopixel-fades-and-color-transitions/

Sorry was not able to reply earlier. When I use for loop and CHSV I get a smoother transition but it still feels the colors are moving from one LED to the next. I have tried using fill_palette which gives a gradual transition but the colors moves in only one direction, I wanted to have the capability of moving the colors in both directions with the same gradual transition. Is there a way to get the similar effect and move the colors back and forth?

Thank you.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.