wilmouths / RGBLed

An Arduino library to control RGB led
GNU General Public License v3.0
42 stars 20 forks source link

New Feature: Cross fade from one color to another #12

Closed hpreston closed 2 years ago

hpreston commented 2 years ago

I wanted to build on the fade capabilities in the Library to support fading form one color directly to another.

This PR does build on the brightness enhancements PR so you'll see all the changes combined. I wanted to give you the ability to decide on this new function/feature separately than the more straightforward brightness adjustment.

Following your pattern for other function, I provide two options for users to provide the from and to color data. A rgb[3] array for from and to can be provided, or 3 int variables for each from and to.

I generally comment my code as I'm writing to keep myself straight. If you'd prefer the comments be cleared out in the PR to match the rest of the library.

Thanks again for the great library and considering PRs.

wilmouths commented 2 years ago

I'm not against comments, it's a bad practice for me not to put any (even in my professional projects as a developer)

The functionality seems interesting to me, I am merge the PR and I will generate a version soon.

Thanks for your contributions

hpreston commented 2 years ago

Thanks for adding this in! Very happy to contribute.

And most of my code for work is designed to be instructive, which means my default is to comment a lot. Has helped me remember why I did something more than once when returning to a project.