From 78bbc577d36f55d57b58f9e8a25192c52b9cffe5 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Wed, 30 Sep 2015 19:38:55 +0200 Subject: [PATCH] Added RandomColorBrush --- CUE.NET.csproj | 1 + Devices/Keyboard/Brushes/RandomColorBrush.cs | 25 ++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 Devices/Keyboard/Brushes/RandomColorBrush.cs diff --git a/CUE.NET.csproj b/CUE.NET.csproj index 61a8821..b7c90ac 100644 --- a/CUE.NET.csproj +++ b/CUE.NET.csproj @@ -53,6 +53,7 @@ + diff --git a/Devices/Keyboard/Brushes/RandomColorBrush.cs b/Devices/Keyboard/Brushes/RandomColorBrush.cs new file mode 100644 index 0000000..c8ff304 --- /dev/null +++ b/Devices/Keyboard/Brushes/RandomColorBrush.cs @@ -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 + } +}