Repository navigation
The following changes to the engine have been made:
- The
Gradientclass now has a constructor to deep copy from another gradient. Gradientscan now also sharply switch between colors, rather than always smoothly interpolating between them. Use.sharp().- #6: Transition logs now have the option to be condensed into a single line rather than two. Use
config.withMergedTransitionLogs().
The following light wrappers have been added/changed:
BreathingLightWrapper: A unary light wrapper forLEDPattern.breathe(). This wrapper will smoothly pulse its pattern over a given time.OverlayLightWrapper: A binary light wrapper forLEDPattern.overlayOn(). This wrapper applies a pattern directly on top of another pattern.- Similarly to
.mask(), the implementation ofLightPattern.overlayOn()differs quite significantly from its base implementation. I believe the original implementation was quite flawed, and I believe this one is an improvement. Overall, the two wrappers have fairly similar behavior.
- Similarly to
- Changed
ScrollLightWrapper: Scrolling now will interpolate between pixels at the corners of the patterns, making the overall affect much smoother. It can be disabled with.sharp().
The following light patterns have been added/changed:
- Changed
RandomLightPattern: This pattern now has the ability to randomize along a true gradient, rather than simply two colors. ProgressBarLightPattern: A powerful pattern that takes aDoubleSupplierto animate a progress bar from left-to-right. Both the active and inactive sections of the bar can be either single colors or entire gradients, and this class can be inherited from.
- In addition, some methods regarding interpolation in a variety of patterns have been renamed to
.sharp()and.smooth()to create a standard convention across the library. Because nobody is using the library at this time, I've opted to make this a breaking change.
Breaking Changes
From 1.2.2: To standardize the naming convention of interpolation in this library, several existing methods have had their names changed to .sharp() and .smooth(). This includes the following:
BounceLightPattern.withFade()->.smooth().withSharp()->.sharp()
RandomLightPattern.withSmoothInterpolation()->.smooth().withRoughInterpolation()->.sharp()
I hope this makes sense. In the future I may do deprecations, but nobody is using the library right now so I have no reason to.
From 1.2.1: Project files moved to root
From 1.1: Suppliers are used in .withStateAll() and .withTransitionAll()
To install:
- Download the source code from this release, extract it, and place the
betterlightsdirectory into yoursrc/java/mainfolder. - Alternatively, you could clone this project directly into your robot code with
git submodule add https://github.com/That-One-Nerd/betterlights.gitrun in yoursrc/main/javadirectory.