Skip to content

Commit

Permalink
Merge pull request #477 from LumpBloom7/Normalise-ring-color
Browse files Browse the repository at this point in the history
Normalise difficulty-based ring colors
  • Loading branch information
LumpBloom7 authored Aug 16, 2023
2 parents 622067d + f21ec6e commit da65944
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion osu.Game.Rulesets.Sentakki/UI/SentakkiPlayfield.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using osu.Game.Skinning;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Utils;

namespace osu.Game.Rulesets.Sentakki.UI
{
Expand Down Expand Up @@ -168,7 +169,13 @@ private void changePlayfieldAccent()
switch (ringColor.Value)
{
case ColorOption.Difficulty:
AccentContainer.FadeColour(colours.ForStarDifficulty(beatmapDifficulty?.Value?.Stars ?? 0), 200);
double starRating = beatmapDifficulty?.Value?.Stars ?? 0;
var colour = colours.ForStarDifficulty(starRating);

// Normalize the colors to make sure the ring is actually visible
colour = Interpolation.ValueAt(0.5f, colour, new HSPAColour(colour) { P = 0.6f }.ToColor4(), 0, 1);

AccentContainer.FadeColour(colour, 200);
break;

case ColorOption.Skin:
Expand Down

0 comments on commit da65944

Please sign in to comment.