Table of Contents

Enum ColorHexFormat

Namespace
SixLabors.ImageSharp
Assembly
SixLabors.ImageSharp.dll

Specifies the channel order when formatting or parsing a color as a hexadecimal string.

public enum ColorHexFormat

Fields

Argb = 1

Uses AARRGGBB channel order where the alpha component comes first, followed by the red, green, and blue components. This matches the Microsoft/XAML convention.

When parsing, supports the following formats:

  • #ARGB expands to AARRGGBB
  • #AARRGGBB used as-is

When formatting, outputs an 8-digit hex string in AARRGGBB order.

Rgba = 0

Uses RRGGBBAA channel order where the red, green, and blue components come first, followed by the alpha component. This matches the CSS Color Module Level 4 and common web standards.

When parsing, supports the following formats:

  • #RGB expands to RRGGBBFF (fully opaque)
  • #RGBA expands to RRGGBBAA
  • #RRGGBB expands to RRGGBBFF (fully opaque)
  • #RRGGBBAA used as-is

When formatting, outputs an 8-digit hex string in RRGGBBAA order.