1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

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

View File

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

View File

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