mirror of
https://github.com/ppy/osu
synced 2024-12-24 15:53:37 +00:00
Add OsuColour
method mapping colours from basic theme to mod types
This commit is contained in:
parent
a5af89d143
commit
cd3641137b
@ -5,6 +5,7 @@ using System;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Utils;
|
||||
@ -157,6 +158,36 @@ namespace osu.Game.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the main accent colour for a <see cref="ModType"/>.
|
||||
/// </summary>
|
||||
public Color4 ForModType(ModType modType)
|
||||
{
|
||||
switch (modType)
|
||||
{
|
||||
case ModType.Automation:
|
||||
return Blue1;
|
||||
|
||||
case ModType.DifficultyIncrease:
|
||||
return Red1;
|
||||
|
||||
case ModType.DifficultyReduction:
|
||||
return Lime1;
|
||||
|
||||
case ModType.Conversion:
|
||||
return Purple1;
|
||||
|
||||
case ModType.Fun:
|
||||
return Pink1;
|
||||
|
||||
case ModType.System:
|
||||
return Gray7;
|
||||
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(modType), modType, "Unknown mod type");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a foreground text colour that is supposed to contrast well with
|
||||
/// the supplied <paramref name="backgroundColour"/>.
|
||||
|
Loading…
Reference in New Issue
Block a user