mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2025-12-12 16:58:29 +00:00
Added RandomColorBrush
This commit is contained in:
parent
70f8a54a38
commit
78bbc577d3
@ -53,6 +53,7 @@
|
||||
<Compile Include="Devices\Keyboard\Brushes\IBrush.cs" />
|
||||
<Compile Include="Devices\Keyboard\Brushes\LinearGradientBrush.cs" />
|
||||
<Compile Include="Devices\Keyboard\Brushes\RadialGradientBrush.cs" />
|
||||
<Compile Include="Devices\Keyboard\Brushes\RandomColorBrush.cs" />
|
||||
<Compile Include="Devices\Keyboard\Brushes\SolidColorBrush.cs" />
|
||||
<Compile Include="Devices\Keyboard\Enums\CorsairLogicalKeyboardLayout.cs" />
|
||||
<Compile Include="Devices\Headset\Enums\CorsairHeadsetLedId.cs" />
|
||||
|
||||
25
Devices/Keyboard/Brushes/RandomColorBrush.cs
Normal file
25
Devices/Keyboard/Brushes/RandomColorBrush.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using CUE.NET.Helper;
|
||||
|
||||
namespace CUE.NET.Devices.Keyboard.Brushes
|
||||
{
|
||||
//TODO DarthAffe 30.09.2015: Like this the brush seems kinda useless. Think about making it cool.
|
||||
public class RandomColorBrush : AbstractBrush
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
private Random _random = new Random();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public override Color GetColorAtPoint(RectangleF rectangle, PointF point)
|
||||
{
|
||||
return FinalizeColor(ColorHelper.ColorFromHSV((float)_random.NextDouble() * 360f, 1, 1));
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user