From 6fd97d67eb9297dbd75467009e511dded79903bd Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Thu, 15 Jul 2021 23:57:48 +0300 Subject: [PATCH] Update colour spectrum inline with latest version From https://github.com/ppy/osu-web/pull/7855#issuecomment-880959644, less arbitrary. --- osu.Game/Graphics/OsuColour.cs | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/osu.Game/Graphics/OsuColour.cs b/osu.Game/Graphics/OsuColour.cs index 6aac78b765..4eb9aa7c94 100644 --- a/osu.Game/Graphics/OsuColour.cs +++ b/osu.Game/Graphics/OsuColour.cs @@ -69,25 +69,18 @@ namespace osu.Game.Graphics } } - public Color4 ForStarDifficulty(double starDifficulty) + public Color4 ForStarDifficulty(double starDifficulty) => ColourUtils.SampleFromLinearGradient(new[] { - var spectrumPoint = (float)(starDifficulty / 8.00); - - if (spectrumPoint > 1f) - return Color4.Black; - - return ColourUtils.SampleFromLinearGradient(new[] - { - (0.2159f, Color4Extensions.FromHex("4fc0ff")), - (0.2693f, Color4Extensions.FromHex("4fffd5")), - (0.3217f, Color4Extensions.FromHex("7cff4f")), - (0.4111f, Color4Extensions.FromHex("f6f05c")), - (0.5767f, Color4Extensions.FromHex("ff8068")), - (0.7307f, Color4Extensions.FromHex("ff3c71")), - (0.8667f, Color4Extensions.FromHex("6563de")), - (0.9996f, Color4Extensions.FromHex("18158e")), - }, spectrumPoint); - } + (1.5f, Color4Extensions.FromHex("4fc0ff")), + (2.0f, Color4Extensions.FromHex("4fffd5")), + (2.5f, Color4Extensions.FromHex("7cff4f")), + (3.25f, Color4Extensions.FromHex("f6f05c")), + (4.5f, Color4Extensions.FromHex("ff8068")), + (6.0f, Color4Extensions.FromHex("ff3c71")), + (7.0f, Color4Extensions.FromHex("6563de")), + (8.0f, Color4Extensions.FromHex("18158e")), + (8.0f, Color4.Black), + }, (float)starDifficulty); /// /// Retrieves the colour for a .