Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/Mono.Android/Android.Graphics/Color.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public struct Color
{
private int color;

#region Constuctors
public Color (int argb)
{
color = argb;
Expand Down Expand Up @@ -48,9 +47,7 @@ public Color (int r, int g, int b, int a)
{
color = FromArgb (r, g, b, a);
}
#endregion

#region Public Properties
/// <summary>
/// Gets or sets the alpha (opacity) component of the color, where 0 is fully transparent and 255 is fully opaque.
/// </summary>
Expand All @@ -74,9 +71,7 @@ public Color (int r, int g, int b, int a)
/// </summary>
/// <value>A <see cref="byte"/> representing the red component, in the range 0–255.</value>
public byte R { get { return (byte)(color >> 16); } set { color = FromArgb (value, G, B, A); } }
#endregion

#region Public Methods
public int ToArgb ()
{
return color;
Expand Down Expand Up @@ -146,9 +141,7 @@ public float GetHue ()

return hue;
}
#endregion

#region Public Static Methods
/// <summary>
/// Extracts the alpha (opacity) component from a packed ARGB color integer, where 0 is fully transparent and 255 is fully opaque.
/// </summary>
Expand Down Expand Up @@ -199,9 +192,7 @@ public static Color Rgb (int red, int green, int blue)
int alpha = 255;
return new Color ((int)((uint)alpha << 24) | (red << 16) | (green << 8) | blue);
}
#endregion

#region Operators
public static bool operator == (Color left, Color right)
{
return left.color == right.color;
Expand All @@ -221,9 +212,7 @@ public override int GetHashCode ()
{
return color;
}
#endregion

#region Private Methods
private static int FromRgb (int red, int green, int blue)
{
int alpha = 255;
Expand Down Expand Up @@ -285,9 +274,7 @@ public static void RGBToHSV (int red, int green, int blue, float[] hsv)
{
ColorObject.RGBToHSV (red, green, blue, hsv);
}
#endregion

#region Known Colors
public static Color Transparent { get { return new Color (0x000000); } }
public static Color AliceBlue { get { return new Color (0xFFF0F8FF); } }
public static Color AntiqueWhite { get { return new Color (0xFFFAEBD7); } }
Expand Down Expand Up @@ -429,7 +416,6 @@ public static void RGBToHSV (int red, int green, int blue, float[] hsv)
public static Color WhiteSmoke { get { return new Color (0xFFF5F5F5); } }
public static Color Yellow { get { return new Color (0xFFFFFF00); } }
public static Color YellowGreen { get { return new Color (0xFF9ACD32); } }
#endregion
}

public class ColorValueMarshaler : JniValueMarshaler<Color>
Expand Down