Draw reversing arrow in black if the slider is lightly colored
This commit is contained in:
parent
ba240797d8
commit
78511737ce
|
@ -234,6 +234,8 @@ public class Slider implements GameObject {
|
|||
for (int tcurRepeat = currentRepeats; tcurRepeat <= currentRepeats + 1; tcurRepeat++) {
|
||||
if (hitObject.getRepeatCount() - 1 > tcurRepeat) {
|
||||
Image arrow = GameImage.REVERSEARROW.getImage();
|
||||
float colorLuminance = 0.299f*color.r + 0.587f*color.g + 0.114f*color.b;
|
||||
Color arrowColor = colorLuminance < 0.8f ? Color.white : Color.black;
|
||||
if (tcurRepeat != currentRepeats) {
|
||||
if (sliderTime == 0)
|
||||
continue;
|
||||
|
@ -244,11 +246,11 @@ public class Slider implements GameObject {
|
|||
if (tcurRepeat % 2 == 0) {
|
||||
// last circle
|
||||
arrow.setRotation(curve.getEndAngle());
|
||||
arrow.drawCentered(endPos.x, endPos.y);
|
||||
arrow.drawCentered(endPos.x, endPos.y, arrowColor);
|
||||
} else {
|
||||
// first circle
|
||||
arrow.setRotation(curve.getStartAngle());
|
||||
arrow.drawCentered(x, y);
|
||||
arrow.drawCentered(x, y, arrowColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user