Class HexColorExtension
Extension methods for conversion between color and string
Inheritance
System.Object
HexColorExtension
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Sartorius.SAF.Presentation.Controls
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
public static class HexColorExtension
Methods
View SourceGetColorFromHex(String)
Converts a hexadecimal string to a Color
Declaration
public static Color GetColorFromHex(this string hexString)
Parameters
Type | Name | Description |
---|---|---|
System.String | hexString | a hexadecimal string |
Returns
Type | Description |
---|---|
System.Windows.Media.Color | a color |
GetHexString(IEnumerable<Byte>)
Converts a byte array to a hexadecimal string
Declaration
public static string GetHexString(this IEnumerable<byte> data)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Byte> | data | the bytearray in form [r, g, b] |
Returns
Type | Description |
---|---|
System.String |
GetHexStringFromColor(Color)
Converts a color to a hexadecimal string
Declaration
public static string GetHexStringFromColor(this Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Media.Color | color | The color to convert |
Returns
Type | Description |
---|---|
System.String | a hexadecimal string |