1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

change SRGBColour to Color4 and use IHasAccentColour in some places

This commit is contained in:
Jorolf 2017-04-08 13:31:55 +02:00
parent 841d101be7
commit 5e56e84c4a
2 changed files with 16 additions and 13 deletions

View File

@ -2,8 +2,8 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using System;
@ -33,11 +33,11 @@ namespace osu.Game.Graphics.UserInterface
}
}
public SRGBColour BackgroundColour
public Color4 BackgroundColour
{
get
{
return background?.Colour ?? default(SRGBColour);
return background?.Colour ?? default(Color4);
}
set
{
@ -51,7 +51,7 @@ namespace osu.Game.Graphics.UserInterface
}
}
public SRGBColour BarColour
public Color4 BarColour
{
get
{

View File

@ -5,7 +5,6 @@ using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
@ -349,11 +348,11 @@ namespace osu.Game.Screens.Select
[BackgroundDependencyLoader]
private void load(OsuColour colour)
{
description.ContentColour = colour.GrayB;
source.ContentColour = colour.GrayB;
tags.ContentColour = colour.YellowLight;
description.AccentColour = colour.GrayB;
source.AccentColour = colour.GrayB;
tags.AccentColour = colour.YellowLight;
stars.BarColour = colour.Yellow;
stars.AccentColour = colour.Yellow;
ratingsBar.BackgroundColour = colour.Green;
ratingsBar.BarColour = colour.YellowDark;
@ -363,7 +362,7 @@ namespace osu.Game.Screens.Select
retryGraph.Colour = colour.Yellow;
}
private class DifficultyRow : Container
private class DifficultyRow : Container, IHasAccentColour
{
private readonly OsuSpriteText name;
private readonly Bar bar;
@ -412,7 +411,7 @@ namespace osu.Game.Screens.Select
}
}
public SRGBColour BarColour
public Color4 AccentColour
{
get
{
@ -458,7 +457,7 @@ namespace osu.Game.Screens.Select
}
}
private class MetadataSegment : Container
private class MetadataSegment : Container, IHasAccentColour
{
private readonly OsuSpriteText header;
private readonly FillFlowContainer<OsuSpriteText> content;
@ -491,8 +490,12 @@ namespace osu.Game.Screens.Select
}
}
public SRGBColour ContentColour
public Color4 AccentColour
{
get
{
return content.Colour;
}
set
{
content.Colour = value;