Xamarin.Forms.Core
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.ValueType
System.Diagnostics.DebuggerDisplay("R={R}, G={G}, B={B}, A={A}, Hue={Hue}, Saturation={Saturation}, Luminosity={Luminosity}")
Xamarin.Forms.TypeConverter(typeof(Xamarin.Forms.ColorTypeConverter))
Class that represents a color and exposes it as RGBA and HSL values.
This type is immutable. Colors can be expressed in the RGB or HSL modes. While the constructor takes R, G, B, and A values, the class also calculates and makes available HSL data for the color.
In XAML, application developers can specify any property that is of type , for example, either as a XAML attribute or as a nested tag. The following code example shows how to specify the text color for a label by using an attribute:
Hello, World!
]]>
The example below shows how to specify the text color for a label by using a nested tag:
Hello, World!
Color.Blue
]]>
Application developers can specify colors in XAML either as a hexadecimal number or as a valid color name.
When specifying a color with a hexadecimal number, app developers can use 3, 4, or 6 digits. If the developer specifies 3 digits, they are interpreted as RGB doublet data for a fully opaque color. For example, "#123" specifies the color that is represented by "#FF112233". If the developer provides a 4-digit hexadecimal number, then the data are interpreted as above, except that the first digit specifies the alpha channel. For example, "#1234" specifies the color that is represented by "#11223344". Finally, if the developer provides a 6 digit hexadecimal number, the data are interpreted as a fully opaque color with those RGB values. For example, "#112233" specifies the color that is represented by "#FF112233".
When specifying a color with a string, app developers can use color name in isolation, or prefix it with "Color.". For example, both Purple and Color.Purple are valid ways to specify the color purple. The following table describes the valid color names that can be used to specify colors in XAML.
ColorShort NameRGB Value- Color.TransparentTransparent0, 0, 0 (With the alpha channel set to 0.)
- Color.AquaAqua0, 255, 255
- Color.BlackBlack0, 0, 0
- Color.BlueBlue0, 0, 255
- Color.FuchsiaFuchsia255, 0, 255
- Color.GrayGray128, 128, 128
- Color.GreenGreen0, 128, 0
- Color.LimeLime0, 255, 0
- Color.MaroonMaroon128, 0, 0
- Color.NavyNavy0, 0, 128
- Color.OliveOlive128, 128, 0
- Color.PurplePurple128, 0, 128
- Color.PinkPink255, 102, 255
- Color.RedRed255, 0, 0
- Color.SilverSilver192, 192, 192
- Color.TealTeal0, 128, 128
- Color.WhiteWhite255, 255, 255
- Color.YellowYellow255, 255, 0
Constructor
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
The luminosity of the gray-scale color.
Initialize a new gray color.
This is equivalent to new Color (value, value, value). The value is clamped to [0-1]. App developers should use the equivalent methods, instead.
Constructor
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
The red component of the color.
The green component of the color.
The blue component of the color.
Initializes a new RGB color.
This is equivalent to new Color (r, g, b, 1). Values are clamped to [0-1]. Prefer the equivalent methods.
Constructor
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
The red component of the color.
The green component of the color.
The blue component of the color.
The alpha component of the color.
Initializes a new RGB color with an alpha channel.
Values are clamped to [0-1].
Property
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.Double
Gets the alpha component of the color.
The Alpha component of the color as a double that is in the inclusive range [0-1].
Property
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Gets the accent or tint color from the application.
A Color.
The accent color is platform and device dependent.
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
The delta (positive or negative) to add to the luminosity channel.
Returns a new Color with a modified luminosity channel.
A new color with a possibly modified luminosity channel.
The parameter is added to the current luminosity, and the resulting luminosity is then clamped to the inclusive range [0,1].
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Aqua, the color that is represented by the RGB value #00ffff.
Property
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.Double
Gets the blue component of the color.
The Blue component of the color as a double that is in the inclusive range [0-1].
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Black, the color that is represented by the RGB value #000000.
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Blue, the color that is represented by the RGB value #0000ff.
Property
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Returns the default color.
The default color.
The Default color is used to unset any Color, and revert to the default one.
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.Boolean
The value to compare to this structure.
Determine if the provided is equivalent to the current Color.
if the provided object is an equivalent Color. Otherwies, .
Overriden.
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
A string that contains the hexadecimal (A)RGB color representation.
Returns a new RGB Color instance with the requested Red, Green, and Blue channels. The Alpha channel is set if contains one.
A color.
When specifying a color with a hexadecimal number, app developers can use 3, 4, 6, or 8 digits. If the developer specifies 3 digits, they are interpreted as RGB doublet data for a fully opaque color. For example, "#123" specifies the color that is represented by "#FF112233". If the developer provides a 4-digit hexadecimal number, then the data are interpreted as above, except that the first digit specifies the alpha channel. For example, "#1234" specifies the color that is represented by "#11223344". If the developer provides a 6 digit hexadecimal number, the data are interpreted as a fully opaque color with those RGB values. For example, "#112233" specifies the color that is represented by "#FF112233". Finally, the developer can explicitly provide an 8-digit number that completely specifies the Alpha, Red, Green, and Blue channels, in that order.
Note that, in the paragraph above, the fully expanded color description is of the format, AARRGGBB. That is: the first pair of hexadecimal digits specifies the Alpha channel; the second pair specifies the Red channel; the third pair specifies the Green channel; and the final pair specifies the Blue channel.
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
The Hue component of the color.
The Saturation component of the color.
The Luminosity component of the color.
The alpha value of the color.
Returns a new HSL Color with an alpha channel
An HSL color
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
The red component of the color.
The green component of the color.
The blue component of the color.
Returns a new rgb color instance.
An RGB color
Component values are clamped to [0,1]. The method is striclty equivalent to new Color (r, g, b), and is present for API consistency.
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
The red component of the color.
The green component of the color.
The blue component of the color.
Returns a new rgb color instance.
A new RGB color.
Component values are clamped to [0,255].
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
The red component of the color.
The green component of the color.
The blue component of the color.
The alpha component of the color.
Returns a new RGBA color instance.
A new RGBA color.
Component values are clamped to [0,1]. The method is striclty equivalent to new Color (r, g, b, a), and is present for API consistency.
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
The red component of the color.
The green component of the color.
The blue component of the color.
The alpha component of the color.
Returns a new RGBA color instance.
A new RGBA color.
Component values are clamped to [0,255].
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
A uint that represents the ARGB value of the color.
Returns a new Color with the requested RGBA value.
An RGBA color.
The parameter must represent an unsigned integer that can be represented by hexadecimal string that matches the format "AARRGGBB".
Field
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Fucshia, the color that is represented by the RGB value #ff00ff.
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.Obsolete("Fuschia is obsolete as of version 1.3, please use the correct spelling of Fuchsia")
Xamarin.Forms.Color
Fucshia, the color that is represented by the RGB value #ff00ff. Deprecated. See Remarks.
Use the color, instead.
Property
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.Double
Gets the Green component of the color.
The Green component of the color as a double that is in the inclusive range [0-1].
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.Int32
Returns the Hashcode for this .
A signed 32-bit hash code.
Overriden.
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Gray, the color that is represented by the RGB value #808080.
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Green, the color that is represented by the RGB value #008000.
Property
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.Double
Gets the Hue of the color.
The Hue component of the color as a double that is in the inclusive range [0-1].
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Lime, the color that is represented by the RGB value #00ff00.
Property
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.Double
Gets the Luminosity fo the color.
The Luminosity component of the color as a double that is in the inclusive range [0-1].
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Maroon, the color that is represented by the RGB value #800000.
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
The alpha multiplicator.
Returns a new color with the alpha channel multiplied by alpha, clamped to the inclusive range [0-1].
A new RGBA color with a possibly new value for its alpha channel. See Remarks.
The resulting color has its alpha channel clamped toto the inclusive range [0-1], preventing invalid colors.
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Navy, the color that is represented by the RGB value #000080.
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Olive, the color that is represented by the RGB value #808000.
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.Boolean
To be added.
To be added.
Returns if represents the same color as .
To be added.
To be added.
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.Boolean
To be added.
To be added.
Returns if does not represent the same color as .
To be added.
To be added.
Field
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Pink, the color that is represented by the RGB value #ff66ff.
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Purple, the color that is represented by the RGB value #800080.
Property
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.Double
Gets the Red component of the color.
The Red component of the color as a double that is in the inclusive range [0-1].
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Red, the color that is represented by the RGB value #ff0000.
Property
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.Double
Gets the Saturation of the color
The Saturation component of the color as a double that is in the inclusive range [0-1].
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Silver, the color that is represented by the RGB value #c0c0c0.
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Teal, the color that is represented by the RGB value #008080.
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
System.String
Returns a string representation of the Color.
A string.
Overriden.
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
The transparent color, represented by the RGB value #00000000.
The Alpha channel of the color is set to 0.
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
White, the color that is represented by the RGB value #ffffff.
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
The modified Hue.
Returns a color with modified Hue, but keeping the same Saturation and Luminosity.
A color.
The Hue is clamped to the inclusive range [0,1]. This method is useful for creating color palettes.
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
The modified luminosity.
Returns a color with modified Luminosity.
A new HSL color.
The new Luminosity is clamped to [0,1]. This method is useful for creating color palettes.
Method
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
The modified Saturation.
Returns a new color with modified Saturation.
A new HSLcolor.
The Saturation is clamped to [0,1]. This method is useful for creating color palettes.
Field
1.0.0.0
1.1.0.0
1.2.0.0
1.3.0.0
1.4.0.0
1.5.0.0
2.0.0.0
Xamarin.Forms.Color
Yellow, the color that is represented by the RGB value #ffff00..