mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Simplify colour retrieval function
This commit is contained in:
@ -125,22 +125,19 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// <returns>The applicable colour.</returns>
|
/// <returns>The applicable colour.</returns>
|
||||||
protected ColourInfo GetColourForBeatIndex(int index)
|
protected ColourInfo GetColourForBeatIndex(int index)
|
||||||
{
|
{
|
||||||
int divIndex = beatDivisor.Value - (index % beatDivisor.Value) - 1;
|
int beat = (index + 1) % beatDivisor.Value;
|
||||||
|
|
||||||
ColourInfo colour = colours.Gray5;
|
ColourInfo colour = colours.Gray5;
|
||||||
|
|
||||||
{
|
|
||||||
for (int i = 0; i < BindableBeatDivisor.VALID_DIVISORS.Length; i++)
|
for (int i = 0; i < BindableBeatDivisor.VALID_DIVISORS.Length; i++)
|
||||||
{
|
{
|
||||||
int divisor = BindableBeatDivisor.VALID_DIVISORS[i];
|
int divisor = BindableBeatDivisor.VALID_DIVISORS[i];
|
||||||
|
|
||||||
if ((divIndex * divisor) % beatDivisor.Value == 0)
|
if ((beat * divisor) % beatDivisor.Value == 0)
|
||||||
{
|
{
|
||||||
colour = BindableBeatDivisor.GetColourFor(divisor, colours);
|
colour = BindableBeatDivisor.GetColourFor(divisor, colours);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int repeatIndex = index / beatDivisor.Value;
|
int repeatIndex = index / beatDivisor.Value;
|
||||||
return colour.MultiplyAlpha(0.5f / (repeatIndex + 1));
|
return colour.MultiplyAlpha(0.5f / (repeatIndex + 1));
|
||||||
|
Reference in New Issue
Block a user