Showing posts with label Colorspace - RGB vs HSL. Show all posts
Showing posts with label Colorspace - RGB vs HSL. Show all posts

Saturday, February 6, 2021

Colorspace conversion between RGB and HSL library code for AVR microcontrollers | ATmega328P

I had a project where I needed to crossfade RGB colors and I thought why not using the HSL color space instead of the RGB color space because with the HSL the code looks neater and the Hue (color), Saturation and Lightness can easily be modified to create all kinds of light effects.

Colorspace conversion between RGB and HSL library code for AVR microcontrollers | ATmega328P

Converting HSL to RGB

HSLtoRGB(hue, saturation, lightness, rgb[])