From 69caa592d29a6c446dc2f99c5f5281f71cf581f1 Mon Sep 17 00:00:00 2001 From: wieslawsoltes Date: Thu, 15 Nov 2018 12:42:18 +0000 Subject: [PATCH] Updated colors --- src/ThemeEditor.Colors/CMYK.cs | 2 +- src/ThemeEditor.Colors/HSV.cs | 8 ++++++++ src/ThemeEditor.Colors/RGB.cs | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/ThemeEditor.Colors/CMYK.cs b/src/ThemeEditor.Colors/CMYK.cs index fe6af6d..26c9e6d 100644 --- a/src/ThemeEditor.Colors/CMYK.cs +++ b/src/ThemeEditor.Colors/CMYK.cs @@ -36,7 +36,7 @@ namespace ThemeEditor.Colors public CMYK(HSV hsv) { - CMYK cmyk = hsv.ToRGB().ToCMYK(); + CMYK cmyk = hsv.ToCMYK(); C = cmyk.C; Y = cmyk.Y; M = cmyk.M; diff --git a/src/ThemeEditor.Colors/HSV.cs b/src/ThemeEditor.Colors/HSV.cs index 5c5bca3..891a589 100644 --- a/src/ThemeEditor.Colors/HSV.cs +++ b/src/ThemeEditor.Colors/HSV.cs @@ -30,6 +30,14 @@ namespace ThemeEditor.Colors V = hsv.V; } + public HSV(CMYK cmyk) + { + HSV hsv = cmyk.ToHSV(); + H = hsv.H; + S = hsv.S; + V = hsv.V; + } + public HSV WithH(double h) => new HSV(h, S, V); public HSV WithS(double s) => new HSV(H, s, V); diff --git a/src/ThemeEditor.Colors/RGB.cs b/src/ThemeEditor.Colors/RGB.cs index 995f769..400127a 100644 --- a/src/ThemeEditor.Colors/RGB.cs +++ b/src/ThemeEditor.Colors/RGB.cs @@ -30,6 +30,14 @@ namespace ThemeEditor.Colors B = rgb.B; } + public RGB(CMYK cmyk) + { + RGB rgb = cmyk.ToRGB(); + R = rgb.R; + G = rgb.G; + B = rgb.B; + } + public RGB WithR(double r) => new RGB(r, G, B); public RGB WithG(double g) => new RGB(R, g, B);