Struct Color
Definition
- Namespace:
- ElmSharp
- Assembly:
- ElmSharp.dll
- API Level:
- preview
The Color is a struct to record the check's state.
public struct Color
Constructors
View SourceColor(Int32, Int32, Int32)
Creates and initializes a new instance of the Color class with RGB parameters.
Declaration
public Color(int r, int g, int b)
Parameters
Type | Name | Description |
---|---|---|
Int32 | r | Red of RGB. |
Int32 | g | Green of RGB. |
Int32 | b | Blue of RGB. |
API Level: preview
View SourceColor(Int32, Int32, Int32, Int32)
Creates and initializes a new instance of the Color class with RGBA parameters.
Declaration
public Color(int r, int g, int b, int a)
Parameters
Type | Name | Description |
---|---|---|
Int32 | r | Red of RGBA. |
Int32 | g | Green of RGBA. |
Int32 | b | Blue of RGBA. |
Int32 | a | Alpha of RGBA. |
API Level: preview
Fields
View SourceAqua
The Aqua is a predefined Color instance. It's RGB value is (0, 255, 255).
Declaration
public static readonly Color Aqua
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceBlack
The Black is a predefined Color instance. It's RGB value is (0, 0, 0).
Declaration
public static readonly Color Black
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceBlue
The Blue is a predefined Color instance. It's RGB value is (0, 0, 255).
Declaration
public static readonly Color Blue
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceFuchsia
The Fuchsia is a predefined Color instance. It's RGB value is (255, 0, 255).
Declaration
public static readonly Color Fuchsia
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceGray
The Gray is a predefined Color instance. It's RGB value is (128, 128, 128).
Declaration
public static readonly Color Gray
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceGreen
The Green is a predefined Color instance. It's RGB value is (0, 128, 0).
Declaration
public static readonly Color Green
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceLime
The Lime is a predefined Color instance. It's RGB value is (0, 255, 0).
Declaration
public static readonly Color Lime
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceMaroon
The Maroon is a predefined Color instance. It's RGB value is (128, 0, 0).
Declaration
public static readonly Color Maroon
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceNavy
The Navy is a predefined Color instance. It's RGB value is (0, 0, 128).
Declaration
public static readonly Color Navy
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceOlive
The Olive is a predefined Color instance. It's RGB value is (128, 128, 0).
Declaration
public static readonly Color Olive
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceOrange
The Orange is a predefined Color instance. It's RGB value is (255, 165, 0).
Declaration
public static readonly Color Orange
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourcePink
The Pink is a predefined Color instance. It's RGB value is (255, 102, 255).
Declaration
public static readonly Color Pink
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourcePurple
The Purple is a predefined Color instance. It's RGB value is (128, 0, 128).
Declaration
public static readonly Color Purple
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceRed
The Red is a predefined Color instance. It's RGB value is (255, 0, 0).
Declaration
public static readonly Color Red
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceSilver
The Silver is a predefined Color instance. It's RGB value is (192, 192, 192).
Declaration
public static readonly Color Silver
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceTeal
The Teal is a predefined Color instance. It's RGB value is (0, 128, 128).
Declaration
public static readonly Color Teal
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceTransparent
The Tansparent is a predefined Color instance. It's RGBA value is (0, 0, 0, 0).
Declaration
public static readonly Color Transparent
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceWhite
The White is a predefined Color instance. It's RGB value is (255, 255, 255).
Declaration
public static readonly Color White
Field Value
Type | Description |
---|---|
Color |
API Level: preview
View SourceYellow
The Yellow is a predefined Color instance. It's RGB value is (255, 255, 0).
Declaration
public static readonly Color Yellow
Field Value
Type | Description |
---|---|
Color |
API Level: preview
Properties
View SourceA
Gets the A value of RGBA. A means the Alpha in color.
Declaration
public int A { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceB
Gets the B value of RGBA. B means the Blue in color.
Declaration
public int B { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceDefault
Gets a default Color instance.
Declaration
public static Color Default { get; }
Property Value
Type | Description |
---|---|
Color |
Remarks
In the default Color instance, the mode type is default with RGBA all set as -1.
API Level: preview
View SourceG
Gets the G value of RGBA. G means the Green in color.
Declaration
public int G { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceIsDefault
Gets whether the Color instance's mode is default or not. The return type is bool.
Declaration
public bool IsDefault { get; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: preview
View SourceR
Gets the R value of RGBA. R means the Red in color.
Declaration
public int R { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
Methods
View SourceEquals(Object)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
Boolean | true if the object and this instance are of the same type and represent the same value. otherwise, false. |
Overrides
API Level: preview
View SourceFromHex(String)
Gets a Color instance with a hexadecimal string parameter.
Declaration
public static Color FromHex(string hex)
Parameters
Type | Name | Description |
---|---|---|
String | hex | Hexadecimal string. |
Returns
Type | Description |
---|---|
Color | New instance of the Color struct. |
API Level: preview
View SourceFromRgb(Int32, Int32, Int32)
Gets a Color instance with R,G,B parameters.
Declaration
public static Color FromRgb(int r, int g, int b)
Parameters
Type | Name | Description |
---|---|---|
Int32 | r | Red of RGB. |
Int32 | g | Green of RGB. |
Int32 | b | Blue of RGB. |
Returns
Type | Description |
---|---|
Color | New instance of the Color struct. |
API Level: preview
View SourceFromRgba(Int32, Int32, Int32, Int32)
Gets a Color instance with R,G,B,A parameters.
Declaration
public static Color FromRgba(int r, int g, int b, int a)
Parameters
Type | Name | Description |
---|---|---|
Int32 | r | Red of RGBA. |
Int32 | g | Green of RGBA. |
Int32 | b | Blue of RGBA. |
Int32 | a | Alpha of RGBA. |
Returns
Type | Description |
---|---|
Color | New instance of the Color struct. |
API Level: preview
View SourceFromUint(UInt32)
Gets a Color instance with an unsigned integer parameter.
Declaration
public static Color FromUint(uint argb)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | argb | Unsigned integer indicates RGBA. |
Returns
Type | Description |
---|---|
Color | New instance of the Color struct. |
API Level: preview
View SourceGetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A 32-bit signed integer hash code. |
Overrides
API Level: preview
View SourceToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | The fully qualified type name. |
Overrides
API Level: preview
Operators
View SourceEquality(Color, Color)
Compares whether the two Color instances are same or not.
Declaration
public static bool operator ==(Color a, Color b)
Parameters
Type | Name | Description |
---|---|---|
Color | a | A Color instance. |
Color | b | A Color instance. |
Returns
Type | Description |
---|---|
Boolean | The result whether the two instances are the same or not. Return type is bool. If they are same, return true. |
API Level: preview
View SourceInequality(Color, Color)
Compares whether the two Color instances are different or not.
Declaration
public static bool operator !=(Color a, Color b)
Parameters
Type | Name | Description |
---|---|---|
Color | a | A Color instance. |
Color | b | A Color instance. |
Returns
Type | Description |
---|---|
Boolean | The result whether the two instances are different or not. Return type is bool. If they are different, return true. |