Skip to content

Commit

Permalink
Update rainbow_trail.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBearodactyl authored Apr 29, 2024
1 parent 7937c1a commit 47378d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/trail_customization/rainbow_trail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
void RainbowTrail::hsv_to_rgb(float &fR, float &fG, float &fB, float &fH, float &fS, float &fV) {
float fC = fV * fS, fHPrime = fmodf(fH / 60.0f, 6), fX = fC * ( 1 - fabsf(fmodf(fHPrime, 2) - 1));
int iHue = static_cast<int>(fHPrime);
// ternary operators are fucking awesome.
fR = ( iHue == 0 )
? fC
: ( iHue == 1 )
Expand Down Expand Up @@ -48,4 +49,4 @@ cocos2d::_ccColor3B RainbowTrail::get_rainbow(float offset, float saturation) {
out.g = static_cast<GLubyte>(G * 255);
out.b = static_cast<GLubyte>(B * 255);
return out;
}
}

0 comments on commit 47378d7

Please sign in to comment.