From 5ded97083a42a848b25b141794524432425ed93d Mon Sep 17 00:00:00 2001 From: Lukasz Baldyga Date: Mon, 16 Nov 2020 05:44:10 +0000 Subject: [PATCH] Completed ColorValue --- .../Verbs/Value/ValueTypes/ColorValue.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Advanced Software Engineering/Advanced Software Engineering/Verbs/Value/ValueTypes/ColorValue.cs b/Advanced Software Engineering/Advanced Software Engineering/Verbs/Value/ValueTypes/ColorValue.cs index c62005d..5de82fe 100644 --- a/Advanced Software Engineering/Advanced Software Engineering/Verbs/Value/ValueTypes/ColorValue.cs +++ b/Advanced Software Engineering/Advanced Software Engineering/Verbs/Value/ValueTypes/ColorValue.cs @@ -5,28 +5,35 @@ namespace Advanced_Software_Engineering.Verbs.Value.ValueTypes { internal class ColorValue : IValue { + Color value; + Type type = typeof(Color); + + public ColorValue(Color value) { + this.value = value; + } + public string GetDescription() { - throw new NotImplementedException(); + return "A color with description " + value.ToString(); } public Type GetOriginalType() { - throw new NotImplementedException(); + return type; } public bool ToBool() { - throw new NotImplementedException(); + return value.GetBrightness() > 0.5; } public Color ToColor() { - throw new NotImplementedException(); + return value; } public double ToDouble() { - throw new NotImplementedException(); + return value.GetBrightness(); } public int ToInt() { - throw new NotImplementedException(); + return value.ToArgb(); } } } \ No newline at end of file