1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 01:58:30 +00:00

Fixed color-operators

This commit is contained in:
Darth Affe 2019-02-24 17:56:49 +01:00
parent c1e2af6fbb
commit 0895627ccf

View File

@ -320,14 +320,42 @@ namespace RGB.NET.Core
/// </summary> /// </summary>
/// <param name="components">The <see cref="ValueTuple"/> containing the components.</param> /// <param name="components">The <see cref="ValueTuple"/> containing the components.</param>
/// <returns>The color.</returns> /// <returns>The color.</returns>
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);
/// <summary> /// <summary>
/// Converts a <see cref="ValueTuple"/> of HSV-components to a <see cref="Color"/>. /// Converts a <see cref="ValueTuple"/> of ARGB-components to a <see cref="Color"/>.
/// </summary> /// </summary>
/// <param name="components">The <see cref="ValueTuple"/> containing the components.</param> /// <param name="components">The <see cref="ValueTuple"/> containing the components.</param>
/// <returns>The color.</returns> /// <returns>The color.</returns>
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);
/// <summary>
/// Converts a <see cref="ValueTuple"/> of ARGB-components to a <see cref="Color"/>.
/// </summary>
/// <param name="components">The <see cref="ValueTuple"/> containing the components.</param>
/// <returns>The color.</returns>
public static implicit operator Color((int r, int g, int b) components) => new Color(components.r, components.g, components.b);
/// <summary>
/// Converts a <see cref="ValueTuple"/> of ARGB-components to a <see cref="Color"/>.
/// </summary>
/// <param name="components">The <see cref="ValueTuple"/> containing the components.</param>
/// <returns>The color.</returns>
public static implicit operator Color((int a, int r, int g, int b) components) => new Color(components.a, components.r, components.g, components.b);
/// <summary>
/// Converts a <see cref="ValueTuple"/> of ARGB-components to a <see cref="Color"/>.
/// </summary>
/// <param name="components">The <see cref="ValueTuple"/> containing the components.</param>
/// <returns>The color.</returns>
public static implicit operator Color((double r, double g, double b) components) => new Color(components.r, components.g, components.b);
/// <summary>
/// Converts a <see cref="ValueTuple"/> of ARGB-components to a <see cref="Color"/>.
/// </summary>
/// <param name="components">The <see cref="ValueTuple"/> containing the components.</param>
/// <returns>The color.</returns>
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 #endregion
} }