From a238637990b41425bf93f2c336f89631083df9f6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 27 Jan 2017 13:50:00 +0900 Subject: [PATCH] Move osu! logo colour declarations to palette. --- osu.Game/Graphics/OsuColour.cs | 7 ++++++- osu.Game/Screens/Menu/OsuLogo.cs | 22 +++++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/osu.Game/Graphics/OsuColour.cs b/osu.Game/Graphics/OsuColour.cs index 1ab5ec8f7c..e7b48b3c86 100644 --- a/osu.Game/Graphics/OsuColour.cs +++ b/osu.Game/Graphics/OsuColour.cs @@ -24,8 +24,13 @@ private static Color4 FromHex(string hex) 255); } - // See https://github.com/ppy/osu-web/blob/master/resources/assets/less/colors.less + //used for osu! logo and triangles contained within. + public Color4 OsuPink = FromHex(@"e967a1"); + public Color4 OsuPinkLight = FromHex(@"ff7db7"); + public Color4 OsuPinkDark= FromHex(@"de5b95"); + + // See https://github.com/ppy/osu-web/blob/master/resources/assets/less/colors.less public Color4 PurpleLighter = FromHex(@"eeeeff"); public Color4 PurpleLight = FromHex(@"aa88ff"); public Color4 Purple = FromHex(@"8866ee"); diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 323b23b920..724a0c5a7f 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -62,6 +62,7 @@ public bool Ripple } public bool Interactive = true; + private Box colourLayer; public OsuLogo() { @@ -101,10 +102,9 @@ public OsuLogo() Origin = Anchor.Centre, Children = new Drawable[] { - new Box + colourLayer = new Box { RelativeSizeAxes = Axes.Both, - Colour = new Color4(233, 103, 161, 255), }, new OsuLogoTriangles { @@ -155,8 +155,10 @@ public OsuLogo() } [BackgroundDependencyLoader] - private void load(TextureStore textures) + private void load(TextureStore textures, OsuColour colour) { + colourLayer.Colour = colour.OsuPink; + logo.Texture = textures.Get(@"Menu/logo@2x"); ripple.Texture = textures.Get(@"Menu/logo@2x"); } @@ -207,11 +209,21 @@ protected override void OnHoverLost(InputState state) class OsuLogoTriangles : Triangles { + private Color4 range1; + private Color4 range2; + public OsuLogoTriangles() { TriangleScale = 4; Alpha = 1; } + + [BackgroundDependencyLoader] + private void load(OsuColour colour) + { + range1 = colour.OsuPinkDark; + range2 = colour.OsuPinkLight; + } protected override Triangle CreateTriangle() { @@ -225,8 +237,8 @@ private Color4 getTriangleShade() { float val = RNG.NextSingle(); return Interpolation.ValueAt(val, - new Color4(222, 91, 149, 255), - new Color4(255, 125, 183, 255), + range1, + range2, 0, 1); } }