mirror of https://github.com/ppy/osu
Move osu! logo colour declarations to palette.
This commit is contained in:
parent
f3e9da609e
commit
a238637990
|
@ -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");
|
||||
|
|
|
@ -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,12 +209,22 @@ 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()
|
||||
{
|
||||
var triangle = base.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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue