Is your feature request related to a problem? Please describe.
The Color Wheel Activity is great but after discussion, @innaamogolonova and @totally-not-frito-lays decided that this function is better left blackboxed to the students. We'll migrate this into the library as a dedicated function alternative to the setColor(r,g,b).
Describe the solution you'd like
Implement / copy this into the existing library functions. We'll need changes to these files:
lantern.h
lantern.cpp
keywords.txt
in library.properties increment version by 0.1.0
Requirements
[ ] The color wheel can accept any number and always output a packed number to result in a color
[ ] There's a corresponding explanation / description in the notion page (dedicated call out block?)
[ ] [Activity] Add color wheel to gradient functions
// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
Is your feature request related to a problem? Please describe. The Color Wheel Activity is great but after discussion, @innaamogolonova and @totally-not-frito-lays decided that this function is better left blackboxed to the students. We'll migrate this into the library as a dedicated function alternative to the
setColor(r,g,b)
.Describe the solution you'd like Implement / copy this into the existing library functions. We'll need changes to these files:
lantern.h
lantern.cpp
keywords.txt
library.properties
increment version by0.1.0
Requirements
Describe alternatives you've considered We considered leaving the implementation as a written function in examples but this is troublesome because:
Additional context Add any other context or screenshots about the feature request here.