Repository navigation
BetterLightStrips 1.1.0
This release adds wrappers for certain concepts, mostly to create higher-level versions of default LEDPattern modifiers. For example, rather than rewriting your custom pattern to work in reverse, simply append the .reverse() to the end of your config declaration and a wrapper will be constructed that reverses your pattern. Animations and everything else still works.
A compatibility wrapper has also been added for if you've written patterns that use LEDPattern (say, as an anonymous function) and don't want to create a LightPattern class. Simply call LightPattern.from() and pass your pattern. Animations must be handled on the LEDPattern side of things, but other than that it should be seamless.
All wrappers (excluding CompatibilityLightWrapper) must derive from LightWrapper.
The following light wrappers have been added:
MappedLightWrapper: A wrapper that will remap LED indices to new ones. Used as a base class for some other wrappers.ReverseLightWrapper: A wrapper that reverses its underlying pattern. Use.reverse().OffsetLightWrapper: A wrapper that offsets the pattern by a given number of pixels. Use.offsetBy().ScrollLightWrapper: A wrapper that scrolls the pattern over time by a given number of pixels per second. Use.scroll().- Note that
.scrollAtRelativeSpeed()and.scrollAtAbsoluteSpeed()are also implemented for the sake of backwards-compatibility. I personally don't like them and would prefer you use.scroll(), but it's up to you.
- Note that
To install: Extract betterlights.v1.1.0.zip and place the net/betterlights directory in your src folder.