Class HexColorExtension
Extension methods for conversion between color and string
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 |
|---|---|---|
| string | hexString | a hexadecimal string |
Returns
| Type | Description |
|---|---|
| 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 |
|---|---|---|
| IEnumerable<byte> | data | the bytearray in form [r, g, b] |
Returns
| Type | Description |
|---|---|
| string |
GetHexStringFromColor(Color)
Converts a color to a hexadecimal string
Declaration
public static string GetHexStringFromColor(this Color color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | color | The color to convert |
Returns
| Type | Description |
|---|---|
| string | a hexadecimal string |