# Color struct

Namespace: [Eto.Drawing](https://eto.picoe.ca/api/namespace/eto.drawing.md) · Assembly: [Eto](https://eto.picoe.ca/api/assembly/eto.md)

```cs
[TypeConverter(ColorConverterInternal)]
public struct Color : IEquatable<Color>, IComparable<Color>, IControlObjectSource
```

Represents a color with RGBA (Red, Green, Blue, and Alpha) components

## Constructors

- [Color](https://eto.picoe.ca/api/type/eto.drawing.color/ctor.md): (3 overloads) Initializes a new instance of the Color object as a copy of the specified `color`

## Properties

- [A](https://eto.picoe.ca/api/type/eto.drawing.color/a.md): Gets or sets the alpha/opacity (0-1)
- [Ab](https://eto.picoe.ca/api/type/eto.drawing.color/ab.md): Gets or sets the alpha/opacity component as a byte of a 32-bit color (0-255)
- [B](https://eto.picoe.ca/api/type/eto.drawing.color/b.md): Gets or sets the blue (0-1)
- [Bb](https://eto.picoe.ca/api/type/eto.drawing.color/bb.md): Gets or sets the blue component as a byte of a 32-bit color (0-255)
- [ControlObject](https://eto.picoe.ca/api/type/eto.drawing.color/controlobject.md): Gets the native color control object.
- [G](https://eto.picoe.ca/api/type/eto.drawing.color/g.md): Gets or sets the green (0-1)
- [Gb](https://eto.picoe.ca/api/type/eto.drawing.color/gb.md): Gets or sets the green component as a byte of a 32-bit color (0-255)
- [R](https://eto.picoe.ca/api/type/eto.drawing.color/r.md): Gets or sets the red component (0-1)
- [Rb](https://eto.picoe.ca/api/type/eto.drawing.color/rb.md): Gets or sets the red component as a byte of a 32-bit color (0-255)

## Methods

- [Blend](https://eto.picoe.ca/api/type/eto.drawing.color/blend.md): (2 overloads, static) Blends the `blendColor` onto the specified `baseColor`, including the Alpha component.
- [Distance](https://eto.picoe.ca/api/type/eto.drawing.color/distance.md): (static) Calculates the distance of the two colors in the RGB scale
- [Equals](https://eto.picoe.ca/api/type/eto.drawing.color/equals.md): (2 overloads) Compares the specified color for equality
- [FromArgb](https://eto.picoe.ca/api/type/eto.drawing.color/fromargb.md): (2 overloads, static) Creates a Color from a 32-bit ARGB value
- [FromElementId](https://eto.picoe.ca/api/type/eto.drawing.color/fromelementid.md): (static) Creates a new color from an Element ID value
- [FromGrayscale](https://eto.picoe.ca/api/type/eto.drawing.color/fromgrayscale.md): (static) Creates a Color with a specified value for the Red, Green, and Blue components
- [FromPremultipliedArgb](https://eto.picoe.ca/api/type/eto.drawing.color/frompremultipliedargb.md): (2 overloads, static) Creates a Color from a premultiplied 32-bit ARGB value
- [FromRgb](https://eto.picoe.ca/api/type/eto.drawing.color/fromrgb.md): (static) Creates a Color from a 24-bit RGB value
- [GetHashCode](https://eto.picoe.ca/api/type/eto.drawing.color/gethashcode.md): Gets the hash code for this Color
- [Invert](https://eto.picoe.ca/api/type/eto.drawing.color/invert.md): Inverts the RGB color values
- [Parse](https://eto.picoe.ca/api/type/eto.drawing.color/parse.md): (static) Converts a string into a new instance of a Color
- [IComparable<Color>.CompareTo](https://eto.picoe.ca/api/type/eto.drawing.color/system-icomparable-eto-drawing-color-compareto.md): Compares two colors for sorting Colors in standard collections.
- [ToArgb](https://eto.picoe.ca/api/type/eto.drawing.color/toargb.md): (2 overloads) Converts this color to a 32-bit ARGB value.
- [ToCMYK](https://eto.picoe.ca/api/type/eto.drawing.color/tocmyk.md): Converts this RGB color to the CMYK colorspace.
- [ToElementId](https://eto.picoe.ca/api/type/eto.drawing.color/toelementid.md): Converts this color to an Element ID value
- [ToHex](https://eto.picoe.ca/api/type/eto.drawing.color/tohex.md): (2 overloads) Converts this color to a hex representation
- [ToHSB](https://eto.picoe.ca/api/type/eto.drawing.color/tohsb.md): Converts this RGB color to the HSB colorspace.
- [ToHSL](https://eto.picoe.ca/api/type/eto.drawing.color/tohsl.md): Converts this RGB color to the HSL colorspace.
- [ToPremultipliedArgb](https://eto.picoe.ca/api/type/eto.drawing.color/topremultipliedargb.md): Converts this color to a premultiplied 32-bit ARGB value, where each of the R, G, B components are first multiplied by the alpha component
- [ToString](https://eto.picoe.ca/api/type/eto.drawing.color/tostring.md): Converts this object to a string
- [TryParse](https://eto.picoe.ca/api/type/eto.drawing.color/tryparse.md): (2 overloads, static) Converts the specified string to a color

## Operators

- [operator ==](https://eto.picoe.ca/api/type/eto.drawing.color/op-equality.md): (static) Compares two Color structs for equality
- [operator !=](https://eto.picoe.ca/api/type/eto.drawing.color/op-inequality.md): (static) Compares two Color structs for inequality
