codewithher / CC-Lantern

Wrapper library for programming cultural lanterns.
GNU General Public License v3.0
0 stars 0 forks source link

21 feature add color wheel #41

Closed totally-not-frito-lays closed 2 months ago

totally-not-frito-lays commented 2 months ago

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, 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.

  1. Using numbers to demonstrate the order of actions to take is great

Check off the following

[^1]: See CONTRIBUTING.md for more information on version semantics