Why:
We've been needing easier access to a color wheel in the library. This PR adds a new example file demonstrating the difference between the rgb and the wheel methods.
Closes the following issues (all PRs must close an issue):
closes #24
What's being changed
Adds a new function, colorWheel() which allows users to use a single number to generate a color. This is useful for noise functions or other similar randomness functions to produce a color.
Technically in #22 we already have a colorWheel implementation but that implementation is not at the library level. The example does not demonstrate how it is implemented, only its usage. There is still merit in maintaining the existing act3-functions around implementing the colorWheel as a rainbow() function instead. Additionally, the rainbow() function actually allows the user to set the amount of time that the rainbow pattern as a whole runs for while the colorWheel only returns a uint32_t / color value.
Testing Instructions
Describe the ways to test it and any relevant information.
Note: the input for colorwheel is a uint8_t which has an unsigned integer range of 0-255. Any values outside of that range get modulo looped. Thus edge tests do not need to be larger than 256 or less than 0.
Edge tests
negative: -50
negative large number: -500
positive: 50
positive large number: 1000
Wheel test
should loop through a rainbow of colors from red -> green -> blue
Using numbers to demonstrate the order of actions to take is great
Check off the following
[x] I have tested my changes locally
[x] I have incremented the version number in the library.properties file [^1]
[^1]: See CONTRIBUTING.md for more information on version semantics
Why: We've been needing easier access to a color wheel in the library. This PR adds a new example file demonstrating the difference between the rgb and the wheel methods.
Closes the following issues (all PRs must close an issue):
What's being changed Adds a new function,
colorWheel()
which allows users to use a single number to generate a color. This is useful for noise functions or other similar randomness functions to produce a color.Technically in #22 we already have a
colorWheel
implementation but that implementation is not at the library level. The example does not demonstrate how it is implemented, only its usage. There is still merit in maintaining the existing act3-functions around implementing the colorWheel as a rainbow() function instead. Additionally, therainbow()
function actually allows the user to set the amount of time that the rainbow pattern as a whole runs for while thecolorWheel
only returns auint32_t
/ color value.Testing Instructions
Note: the input for colorwheel is a
uint8_t
which has an unsigned integer range of 0-255. Any values outside of that range get modulo looped. Thus edge tests do not need to be larger than 256 or less than 0.-50
-500
50
1000
Check off the following
[^1]: See CONTRIBUTING.md for more information on version semantics