Share colour constants with default drawable piece implementations

This commit is contained in:
Dean Herbert
2021-06-11 14:20:08 +09:00
parent bc3b7233ab
commit 9c34cb0777
3 changed files with 8 additions and 6 deletions

View File

@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
{ {
public readonly Bindable<HitType> TypeBindable = new Bindable<HitType>(); public readonly Bindable<HitType> TypeBindable = new Bindable<HitType>();
public Bindable<Color4> DisplayColour { get; } = new Bindable<Color4>(colour_centre); public Bindable<Color4> DisplayColour { get; } = new Bindable<Color4>(COLOUR_CENTRE);
/// <summary> /// <summary>
/// The <see cref="HitType"/> that actuates this <see cref="Hit"/>. /// The <see cref="HitType"/> that actuates this <see cref="Hit"/>.
@ -25,15 +25,15 @@ namespace osu.Game.Rulesets.Taiko.Objects
set => TypeBindable.Value = value; set => TypeBindable.Value = value;
} }
private static readonly Color4 colour_centre = Color4Extensions.FromHex(@"bb1177"); public static readonly Color4 COLOUR_CENTRE = Color4Extensions.FromHex(@"bb1177");
private static readonly Color4 colour_rim = Color4Extensions.FromHex(@"2299bb"); public static readonly Color4 COLOUR_RIM = Color4Extensions.FromHex(@"2299bb");
public Hit() public Hit()
{ {
TypeBindable.BindValueChanged(_ => TypeBindable.BindValueChanged(_ =>
{ {
updateSamplesFromType(); updateSamplesFromType();
DisplayColour.Value = Type == HitType.Centre ? colour_centre : colour_rim; DisplayColour.Value = Type == HitType.Centre ? COLOUR_CENTRE : COLOUR_RIM;
}); });
SamplesBindable.BindCollectionChanged((_, __) => updateTypeFromSamples()); SamplesBindable.BindCollectionChanged((_, __) => updateTypeFromSamples());

View File

@ -6,6 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Rulesets.Taiko.Objects;
using osuTK; using osuTK;
namespace osu.Game.Rulesets.Taiko.Skinning.Default namespace osu.Game.Rulesets.Taiko.Skinning.Default
@ -20,7 +21,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
AccentColour = colours.PinkDarker; AccentColour = Hit.COLOUR_CENTRE;
} }
/// <summary> /// <summary>

View File

@ -6,6 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Rulesets.Taiko.Objects;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
@ -21,7 +22,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
AccentColour = colours.BlueDarker; AccentColour = Hit.COLOUR_RIM;
} }
/// <summary> /// <summary>