ChartColor Struct
An sRGB color with an alpha channel, 8 bits per channel.
public readonly struct ChartColor : IEquatable<ChartColor>- Implements
Constructors
| Name | Description |
|---|---|
| ChartColor(byte, byte, byte, byte) | An sRGB color with an alpha channel, 8 bits per channel. |
ChartColor(byte, byte, byte, byte)
Properties
| Name | Description |
|---|---|
| A | The alpha channel: 0 is transparent, 255 is opaque. |
| B | The blue channel. |
| Black | Gets the opaque black color. |
| G | The green channel. |
| IsOpaque | Gets a value that indicates whether the color is fully opaque. |
| Opacity | Gets the opacity of the color, from 0 to 1. |
| R | The red channel. |
| Transparent | Gets the transparent color. |
| White | Gets the opaque white color. |
Black
ChartColor.csIsOpaque
ChartColor.csOpacity
ChartColor.csTransparent
ChartColor.csWhite
ChartColor.csMethods
| Name | Description |
|---|---|
| Deconstruct(byte, byte, byte, byte) | |
| Equals(ChartColor) | |
| Equals(object) | |
| GetHashCode() | |
| Parse(string) | Parses a color: #rgb, #rgba, #rrggbb, #rrggbbaa, or a common CSS color name such as steelblue. |
| ToHexRgb() | Returns the color as #rrggbb, without its alpha channel. |
| ToString() | Returns the color as #rrggbb, or #rrggbbaa when it is not opaque. |
| TryParse(string?, ChartColor) | Tries to parse a color: #rgb, #rgba, #rrggbb, #rrggbbaa, or a common CSS color name. |
| WithOpacity(double) | Returns a copy of the color with another opacity. |
Deconstruct(byte, byte, byte, byte)
Equals overloads
Equals(ChartColor)
public bool Equals(ChartColor other)No documentation is available.
Equals(object)
GetHashCode()
Parse(string)
ChartColor.csParses a color: #rgb, #rgba, #rrggbb, #rrggbbaa, or a common CSS color name such as steelblue.
public static ChartColor Parse(string value)Parameters
valuestring- The text to parse.
Returns
ChartColor The color.
Exceptions
FormatExceptionvalueis not a supported color.
ToHexRgb()
ChartColor.csToString()
ChartColor.csTryParse(string?, ChartColor)
ChartColor.csTries to parse a color: #rgb, #rgba, #rrggbb, #rrggbbaa, or a common CSS color name.
public static bool TryParse(string? value, out ChartColor color)Parameters
valuestring?- The text to parse.
colorChartColor- The color, when the method returns
true.
Returns
bool true when value is a supported color.
WithOpacity(double)
ChartColor.csReturns a copy of the color with another opacity.
public ChartColor WithOpacity(double opacity)Operators
| Name | Description |
|---|---|
| operator ==(ChartColor, ChartColor) | |
| implicit operator ChartColor(string) | Converts a text to a color with ChartColor.Parse. |
| operator !=(ChartColor, ChartColor) |
operator ==(ChartColor, ChartColor)
public static bool operator ==(ChartColor left, ChartColor right)No documentation is available.
implicit operator ChartColor(string)
ChartColor.csConverts a text to a color with ChartColor.Parse.
public static implicit operator ChartColor(string value)operator !=(ChartColor, ChartColor)
public static bool operator !=(ChartColor left, ChartColor right)No documentation is available.