1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 10:07:36 +08:00

Use OsuColour.Red1 for ControlItemClose hover colour

This commit is contained in:
Jai Sharma 2022-03-14 21:10:39 +00:00
parent e91af664ef
commit 9621ef9437
2 changed files with 11 additions and 3 deletions

View File

@ -8,6 +8,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Chat;
@ -23,6 +24,9 @@ namespace osu.Game.Tests.Visual.Online
[Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Pink);
[Cached]
private readonly OsuColour osuColour = new OsuColour();
[Cached]
private readonly Bindable<Channel> selected = new Bindable<Channel>();

View File

@ -1,12 +1,13 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays.Chat.ChannelControl
{
@ -14,6 +15,9 @@ namespace osu.Game.Overlays.Chat.ChannelControl
{
private readonly SpriteIcon icon;
[Resolved]
private OsuColour osuColour { get; set; } = null!;
public ControlItemClose()
{
Alpha = 0f;
@ -42,13 +46,13 @@ namespace osu.Game.Overlays.Chat.ChannelControl
protected override bool OnHover(HoverEvent e)
{
icon.FadeColour(Color4.Red, 200, Easing.OutQuint);
icon.FadeColour(osuColour.Red1, 200, Easing.OutQuint);
return base.OnHover(e);
}
protected override void OnHoverLost(HoverLostEvent e)
{
icon.FadeColour(Color4.White, 200, Easing.OutQuint);
icon.FadeColour(Colour4.White, 200, Easing.OutQuint);
base.OnHoverLost(e);
}
}