|
|
|
@ -62,12 +62,19 @@ namespace SixLabors.ImageSharp |
|
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
|
public Color(Vector4 vector) => this.data = new Rgba64(vector); |
|
|
|
|
|
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
|
/// <summary>
|
|
|
|
/// Converts a <see cref="Color"/> to <see cref="Vector4"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="color">The <see cref="Color"/>.</param>
|
|
|
|
/// <returns>The <see cref="Vector4"/>.</returns>
|
|
|
|
public static explicit operator Vector4(Color color) => color.data.ToVector4(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Converts an <see cref="Vector4"/> to <see cref="Color"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="source">The <see cref="Vector4"/>.</param>
|
|
|
|
/// <returns>The <see cref="Color"/>.</returns>
|
|
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
|
public static explicit operator Color(Vector4 source) => new Color(source); |
|
|
|
|
|
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
|
@ -84,12 +91,5 @@ namespace SixLabors.ImageSharp |
|
|
|
|
|
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
|
internal Bgr24 ToBgr24() => this.data.ToBgr24(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Converts a <see cref="Color"/> to <see cref="Vector4"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="color">The <see cref="Color"/>.</param>
|
|
|
|
/// <returns>The <see cref="Vector4"/>.</returns>
|
|
|
|
public static explicit operator Vector4(Color color) => color.data.ToVector4(); |
|
|
|
} |
|
|
|
} |