Definition
- Namespace:
- Tizen.Common
- Assembly:
- Tizen.dll
- API Level:
- 3
Structure that represents a color as RGBA.
public struct Color : IEquatable<Color>
- Implements
-
Constructors
View Source
Color(Int32, Int32, Int32)
Initiates the new color with R,G,B components. The Alpha value will be 255 as default.
Declaration
public Color(int r, int g, int b)
Parameters
Type |
Name |
Description |
System.Int32 |
r |
Red (0 ~ 255).
|
System.Int32 |
g |
Green (0 ~ 255).
|
System.Int32 |
b |
Blue (0 ~ 255).
|
API Level: 3
View Source
Color(Int32, Int32, Int32, Int32)
Initiates the new color with R,G,B,A components.
Declaration
public Color(int r, int g, int b, int a)
Parameters
Type |
Name |
Description |
System.Int32 |
r |
Red (0 ~ 255).
|
System.Int32 |
g |
Green (0 ~ 255).
|
System.Int32 |
b |
Blue (0 ~ 255).
|
System.Int32 |
a |
Alpha (0 ~ 255).
|
API Level: 3
Fields
View Source
Aqua
Aqua color instance. Its RGB value is (0, 255, 255).
Declaration
public static readonly Color Aqua
Field Value
API Level: 3
View Source
Black
Black color instance. Its RGB value is (0, 0, 0).
Declaration
public static readonly Color Black
Field Value
API Level: 3
View Source
Blue
Blue color instance. Its RGB value is (0, 0, 255).
Declaration
public static readonly Color Blue
Field Value
API Level: 3
View Source
Empty
Empty color instance. All components are 0.
Declaration
public static readonly Color Empty
Field Value
API Level: 3
View Source
Fuchsia
Fuchsia color instance. Its RGB value is (255, 0, 255).
Declaration
public static readonly Color Fuchsia
Field Value
API Level: 3
View Source
Gray
Gray color instance. Its RGB value is (128, 128, 128).
Declaration
public static readonly Color Gray
Field Value
API Level: 3
View Source
Green
Green color instance. Its RGB value is (0, 128, 0).
Declaration
public static readonly Color Green
Field Value
API Level: 3
View Source
Lime
Lime color instance. Its RGB value is (0, 255, 0).
Declaration
public static readonly Color Lime
Field Value
API Level: 3
View Source
Maroon
Maroon color instance. Its RGB value is (128, 0, 0).
Declaration
public static readonly Color Maroon
Field Value
API Level: 3
View Source
Navy
Navy color instance. Its RGB value is (0, 0, 128).
Declaration
public static readonly Color Navy
Field Value
API Level: 3
View Source
Olive
Olive color instance. Its RGB value is (128, 128, 0).
Declaration
public static readonly Color Olive
Field Value
API Level: 3
View Source
Pink
Pink color instance. Its RGB value is (255, 102, 255).
Declaration
public static readonly Color Pink
Field Value
API Level: 3
View Source
Purple
Purple color instance. Its RGB value is (128, 0, 128).
Declaration
public static readonly Color Purple
Field Value
API Level: 3
View Source
Red
Red color instance. Its RGB value is (255, 0, 0).
Declaration
public static readonly Color Red
Field Value
API Level: 3
View Source
Silver
Silver color instance. Its RGB value is (192, 192, 192).
Declaration
public static readonly Color Silver
Field Value
API Level: 3
View Source
Teal
Teal color instance. Its RGB value is (0, 128, 128).
Declaration
public static readonly Color Teal
Field Value
API Level: 3
View Source
Transparent
Transparent color instance. All components are 0.
Declaration
public static readonly Color Transparent
Field Value
API Level: 3
View Source
White
White color instance. Its RGB value is (255, 255, 255).
Declaration
public static readonly Color White
Field Value
API Level: 3
View Source
Yellow
Yellow color instance. Its RGB value is (255, 255, 0).
Declaration
public static readonly Color Yellow
Field Value
API Level: 3
Properties
Declaration
Property Value
Type |
Description |
System.Int32 |
|
API Level: 3
Declaration
Property Value
Type |
Description |
System.Int32 |
|
API Level: 3
Declaration
Property Value
Type |
Description |
System.Int32 |
|
API Level: 3
Declaration
Property Value
Type |
Description |
System.Int32 |
|
API Level: 3
Methods
View Source
Equals(Object)
Returns a boolean indicating whether the given object is equal to this Color instance.
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
The object to compare against.
|
Returns
Type |
Description |
System.Boolean |
True if the object is equal to this color; False otherwise.
|
Overrides
System.ValueType.Equals(System.Object)
API Level: 3
View Source
Equals(Color)
Returns a boolean indicating whether the given color is equal to this Color instance.
Declaration
public bool Equals(Color other)
Parameters
Type |
Name |
Description |
Color |
other |
The color to compare this instance to.
|
Returns
Type |
Description |
System.Boolean |
True if the other color is equal to this instance; False otherwise.
|
API Level: 3
View Source
FromHex(String)
Returns a new RGB color instance with the requested Red, Green, and Blue channels. The Alpha channel is set if hex contains one.
Declaration
public static Color FromHex(string hex)
Parameters
Type |
Name |
Description |
System.String |
hex |
A string that contains the hexadecimal RGB(A) color representation.
|
Returns
Type |
Description |
Color |
The RGBA color instance.
|
API Level: 3
View Source
FromRgb(Int32, Int32, Int32)
Returns a new RGB color instance.
Declaration
public static Color FromRgb(int r, int g, int b)
Parameters
Type |
Name |
Description |
System.Int32 |
r |
The Red component of the color.
|
System.Int32 |
g |
The Green component of the color.
|
System.Int32 |
b |
The Blue component of the color.
|
Returns
API Level: 3
View Source
FromRgba(Int32, Int32, Int32, Int32)
Returns a new RGBA color instance.
Declaration
public static Color FromRgba(int r, int g, int b, int a)
Parameters
Type |
Name |
Description |
System.Int32 |
r |
The Red component of the color.
|
System.Int32 |
g |
The Green component of the color.
|
System.Int32 |
b |
The Blue component of the color.
|
System.Int32 |
a |
The Alpha component of the color.
|
Returns
Type |
Description |
Color |
The RGBA color instance.
|
API Level: 3
View Source
GetArgb()
Gets the 32-bits ARGB value of the color.
Declaration
Returns
Type |
Description |
System.Int32 |
|
API Level: 3
View Source
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
The hash code.
|
Overrides
System.ValueType.GetHashCode()
API Level: 3
View Source
GetRgba()
Gets the 32-bits RGBA value of the color.
Declaration
Returns
Type |
Description |
System.Int32 |
|
API Level: 3
View Source
ToHex()
Returns a string representation in Hex (For example: #FFFFFFFF in RGBA order).
Declaration
Returns
Type |
Description |
System.String |
The string representation in Hex.
|
API Level: 3
View Source
ToString()
Returns a string representation of the color.
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
The string representation.
|
Overrides
System.ValueType.ToString()
API Level: 3
Operators
View Source
Equality(Color, Color)
Returns a boolean indicating whether the two given colors are equal.
Declaration
public static bool operator ==(Color color1, Color color2)
Parameters
Type |
Name |
Description |
Color |
color1 |
The first color to compare.
|
Color |
color2 |
The second color to compare.
|
Returns
Type |
Description |
System.Boolean |
True if the colors are equal; False otherwise.
|
API Level: 3
View Source
Inequality(Color, Color)
Returns a boolean indicating whether the two given colors are not equal.
Declaration
public static bool operator !=(Color color1, Color color2)
Parameters
Type |
Name |
Description |
Color |
color1 |
The first color to compare.
|
Color |
color2 |
The second color to compare.
|
Returns
Type |
Description |
System.Boolean |
True if the colors are not equal; False if they are equal.
|
API Level: 3
Implements