mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 09:03:50 +09:00
Add OsuColour
method mapping colours from basic theme to mod types
This commit is contained in:
@ -5,6 +5,7 @@ using System;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Utils;
|
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>
|
/// <summary>
|
||||||
/// Returns a foreground text colour that is supposed to contrast well with
|
/// Returns a foreground text colour that is supposed to contrast well with
|
||||||
/// the supplied <paramref name="backgroundColour"/>.
|
/// the supplied <paramref name="backgroundColour"/>.
|
||||||
|
Reference in New Issue
Block a user