mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Switch Colour{Display,Palette}
to use Colour4
This commit is contained in:
@ -53,15 +53,15 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
component.Colours.AddRange(new[]
|
component.Colours.AddRange(new[]
|
||||||
{
|
{
|
||||||
Color4.DarkRed,
|
Colour4.DarkRed,
|
||||||
Color4.Aquamarine,
|
Colour4.Aquamarine,
|
||||||
Color4.Goldenrod,
|
Colour4.Goldenrod,
|
||||||
Color4.Gainsboro
|
Colour4.Gainsboro
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private Color4 randomColour() => new Color4(
|
private Colour4 randomColour() => new Color4(
|
||||||
RNG.NextSingle(),
|
RNG.NextSingle(),
|
||||||
RNG.NextSingle(),
|
RNG.NextSingle(),
|
||||||
RNG.NextSingle(),
|
RNG.NextSingle(),
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
@ -11,22 +10,21 @@ using osu.Framework.Graphics.UserInterface;
|
|||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterfaceV2
|
namespace osu.Game.Graphics.UserInterfaceV2
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A component which displays a colour along with related description text.
|
/// A component which displays a colour along with related description text.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ColourDisplay : CompositeDrawable, IHasCurrentValue<Color4>
|
public class ColourDisplay : CompositeDrawable, IHasCurrentValue<Colour4>
|
||||||
{
|
{
|
||||||
private readonly BindableWithCurrent<Color4> current = new BindableWithCurrent<Color4>();
|
private readonly BindableWithCurrent<Colour4> current = new BindableWithCurrent<Colour4>();
|
||||||
|
|
||||||
private Box fill;
|
private Box fill;
|
||||||
private OsuSpriteText colourHexCode;
|
private OsuSpriteText colourHexCode;
|
||||||
private OsuSpriteText colourName;
|
private OsuSpriteText colourName;
|
||||||
|
|
||||||
public Bindable<Color4> Current
|
public Bindable<Colour4> Current
|
||||||
{
|
{
|
||||||
get => current.Current;
|
get => current.Current;
|
||||||
set => current.Current = value;
|
set => current.Current = value;
|
||||||
|
@ -8,7 +8,6 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterfaceV2
|
namespace osu.Game.Graphics.UserInterfaceV2
|
||||||
{
|
{
|
||||||
@ -17,7 +16,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ColourPalette : CompositeDrawable
|
public class ColourPalette : CompositeDrawable
|
||||||
{
|
{
|
||||||
public BindableList<Color4> Colours { get; } = new BindableList<Color4>();
|
public BindableList<Colour4> Colours { get; } = new BindableList<Colour4>();
|
||||||
|
|
||||||
private string colourNamePrefix = "Colour";
|
private string colourNamePrefix = "Colour";
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osuTK.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterfaceV2
|
namespace osu.Game.Graphics.UserInterfaceV2
|
||||||
{
|
{
|
||||||
@ -13,7 +13,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public BindableList<Color4> Colours => Component.Colours;
|
public BindableList<Colour4> Colours => Component.Colours;
|
||||||
|
|
||||||
public string ColourNamePrefix
|
public string ColourNamePrefix
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
@ -32,7 +33,7 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
|
|
||||||
var colours = Beatmap.BeatmapSkin?.GetConfig<GlobalSkinColours, IReadOnlyList<Color4>>(GlobalSkinColours.ComboColours)?.Value;
|
var colours = Beatmap.BeatmapSkin?.GetConfig<GlobalSkinColours, IReadOnlyList<Color4>>(GlobalSkinColours.ComboColours)?.Value;
|
||||||
if (colours != null)
|
if (colours != null)
|
||||||
comboColours.Colours.AddRange(colours);
|
comboColours.Colours.AddRange(colours.Select(c => (Colour4)c));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user