From 7e307fca9be66d791faba154d4a89088a934e6b6 Mon Sep 17 00:00:00 2001 From: zlotap Date: Tue, 22 Sep 2015 15:08:36 +0200 Subject: [PATCH 1/3] defined ColorBrush, added Interface as definition --- Devices/Keyboard/ColorBrushes/IBrush.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Devices/Keyboard/ColorBrushes/IBrush.cs diff --git a/Devices/Keyboard/ColorBrushes/IBrush.cs b/Devices/Keyboard/ColorBrushes/IBrush.cs new file mode 100644 index 0000000..7ca448e --- /dev/null +++ b/Devices/Keyboard/ColorBrushes/IBrush.cs @@ -0,0 +1,11 @@ +using System.Drawing.Color; +using System.Drawing.Point; + +namespace CUE.NET.Devices.Keyboard.ColorBrushes + +{ + public interface IBrush + { + public Color getColorAtPoint(Point point); + } +} \ No newline at end of file From 6241d262ec198c5c457c3befd33fc793e78416b3 Mon Sep 17 00:00:00 2001 From: zlotap Date: Tue, 22 Sep 2015 17:05:26 +0200 Subject: [PATCH 2/3] implemented SolidColorBrush --- .../Keyboard/ColorBrushes/SolidColorBrush.cs | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Devices/Keyboard/ColorBrushes/SolidColorBrush.cs diff --git a/Devices/Keyboard/ColorBrushes/SolidColorBrush.cs b/Devices/Keyboard/ColorBrushes/SolidColorBrush.cs new file mode 100644 index 0000000..21d0b68 --- /dev/null +++ b/Devices/Keyboard/ColorBrushes/SolidColorBrush.cs @@ -0,0 +1,38 @@ +using System.Drawing; + +namespace CUE.NET.Devices.Keyboard.ColorBrushes +{ + public class SolidColorBrush : IBrush + { + Color color; + + #region Constructors + + public SolidColorBrush(Color color) + { + this.color = color; + } + + #endregion + + #region Methods + + public Color getColorAtPoint(Point point) + { + /* a solid color brush returns the same color no matter the point */ + return this.color; + } + + public Color getColor() + { + return this.color; + } + + public void setColor(Color color) + { + this.color = color; + } + + #endregion + } +} \ No newline at end of file From 98bbd57fd8abe621b4ca8839e110c9728d9d2b4b Mon Sep 17 00:00:00 2001 From: zlotap Date: Tue, 22 Sep 2015 17:07:12 +0200 Subject: [PATCH 3/3] refactor imports --- Devices/Keyboard/ColorBrushes/IBrush.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Devices/Keyboard/ColorBrushes/IBrush.cs b/Devices/Keyboard/ColorBrushes/IBrush.cs index 7ca448e..594ad08 100644 --- a/Devices/Keyboard/ColorBrushes/IBrush.cs +++ b/Devices/Keyboard/ColorBrushes/IBrush.cs @@ -1,11 +1,10 @@ -using System.Drawing.Color; -using System.Drawing.Point; +using System.Drawing; namespace CUE.NET.Devices.Keyboard.ColorBrushes { public interface IBrush { - public Color getColorAtPoint(Point point); + Color getColorAtPoint(Point point); } } \ No newline at end of file