Skip to main content

ToHexString Method

Converts the given color to its hex color value string representation.

Definition

Namespace: Avalonia.Controls.Converters
Assembly: Avalonia.Controls.ColorPicker (in Avalonia.Controls.ColorPicker.dll)

public static string ToHexString(
Color color,
AlphaComponentPosition alphaPosition,
bool includeAlpha = true,
bool includeSymbol = false
)

Parameters

  Color
The color to represent as a hex value string.
  AlphaComponentPosition
The output position of the alpha component.
  Boolean  (Optional)
Whether the alpha component will be included in the hex string.
  Boolean  (Optional)
Whether the hex symbol '#' will be added.

Return Value

String
The input color converted to its hex value string.

See Also

Reference

ColorToHexConverter Class
Avalonia.Controls.Converters Namespace