From 0895627ccf0911ee861b708a97560a75ea4bfc31 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sun, 24 Feb 2019 17:56:49 +0100 Subject: [PATCH] Fixed color-operators --- RGB.NET.Core/Color/Color.cs | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/RGB.NET.Core/Color/Color.cs b/RGB.NET.Core/Color/Color.cs index 3c0667e..20d7f9c 100644 --- a/RGB.NET.Core/Color/Color.cs +++ b/RGB.NET.Core/Color/Color.cs @@ -320,14 +320,42 @@ namespace RGB.NET.Core /// /// The containing the components. /// The color. - public static implicit operator Color((byte a, byte r, byte g, byte b) components) => new Color(components.a, components.r, components.g, components.b); + public static implicit operator Color((byte r, byte g, byte b) components) => new Color(components.r, components.g, components.b); /// - /// Converts a of HSV-components to a . + /// Converts a of ARGB-components to a . /// /// The containing the components. /// The color. - public static implicit operator Color((double hue, double saturation, double value) components) => new Color(components.hue, components.saturation, components.value); + public static implicit operator Color((byte a, byte r, byte g, byte b) components) => new Color(components.a, components.r, components.g, components.b); + + /// + /// Converts a of ARGB-components to a . + /// + /// The containing the components. + /// The color. + public static implicit operator Color((int r, int g, int b) components) => new Color(components.r, components.g, components.b); + + /// + /// Converts a of ARGB-components to a . + /// + /// The containing the components. + /// The color. + public static implicit operator Color((int a, int r, int g, int b) components) => new Color(components.a, components.r, components.g, components.b); + + /// + /// Converts a of ARGB-components to a . + /// + /// The containing the components. + /// The color. + public static implicit operator Color((double r, double g, double b) components) => new Color(components.r, components.g, components.b); + + /// + /// Converts a of ARGB-components to a . + /// + /// The containing the components. + /// The color. + public static implicit operator Color((double a, double r, double g, double b) components) => new Color(components.a, components.r, components.g, components.b); #endregion }