Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daniel/orbit/blend and randomizer fix #206

Merged
merged 4 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions VortexEngine/src/Menus/MenuList/Randomizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,13 @@ bool Randomizer::rollCustomPattern(Random &ctx, Mode *pMode, LedPos pos)
// colors instead of blinking each color in the set
if (!ctx.next8(0, 3)) {
newPat = PATTERN_BLEND;
// this is the number of blinks to a complementary color
args.arg7 = ctx.next8(0, 3);
// set the blend speed
args.arg6 = ctx.next8(1, 10);
// 1/2 chance to make the blend a flipping blend of some kind
if (!ctx.next8(0, 2)) {
// this is the number of blinks to a complementary color
args.arg7 = ctx.next8(0, 3);
}
// up to arg7 is filled now
args.numArgs = 7;
}
Expand Down
5 changes: 4 additions & 1 deletion VortexEngine/src/Patterns/Single/BlendPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ void BlendPattern::onBlinkOn()
interpolate(m_cur.green, m_next.green);
interpolate(m_cur.blue, m_next.blue);
RGBColor col = m_cur;
if (m_flip) {
// it should be impossible for m_numFlips to be 0 and m_flip to be 1
// unless the pattern arg is changed mid-play which could happen with
// and editor or something, so check both for 0
if (m_flip && m_numFlips) {
// convert to hsv
HSVColor hsvCol = m_cur;
// shift the hue by a flip size
Expand Down