/// <summary>
        /// Converts a <see cref="NSColor"/> into the cocoa native <see cref="SplatColor"/>.
        /// </summary>
        /// <param name="value">The color to convert.</param>
        /// <returns>The <see cref="SplatColor"/> generated.</returns>
        public static SplatColor FromNative(this NSColor value)
        {
            if (value is null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            value.GetRgba(out var r, out var g, out var b, out var a);
            return(SplatColor.FromArgb((int)(a * 255.0f), (int)(r * 255.0f), (int)(g * 255.0f), (int)(b * 255.0f)));
        }
Beispiel #2
0
 /// <summary>
 /// Converts a <see cref="Color"/> into the android native <see cref="SplatColor"/>.
 /// </summary>
 /// <param name="value">The color to convert.</param>
 /// <returns>The <see cref="SplatColor"/> generated.</returns>
 public static SplatColor FromNative(this Color value)
 {
     return(SplatColor.FromArgb(value.A, value.R, value.G, value.B));
 }
Beispiel #3
0
 /// <summary>
 /// Converts a <see cref="NSColor"/> into the cocoa native <see cref="SplatColor"/>.
 /// </summary>
 /// <param name="value">The color to convert.</param>
 /// <returns>The <see cref="SplatColor"/> generated.</returns>
 public static SplatColor FromNative(this NSColor value)
 {
     value.GetRgba(out var r, out var g, out var b, out var a);
     return(SplatColor.FromArgb((int)(a * 255.0f), (int)(r * 255.0f), (int)(g * 255.0f), (int)(b * 255.0f)));
 }