Click or drag to resize

Color Structure

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

Namespace:  Eto.Drawing
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
public struct Color : IEquatable<Color>, 
	IComparable<Color>, IControlObjectSource

The Color type exposes the following members.

Constructors
  NameDescription
Public methodColor(Color, NullableSingle)
Initializes a new instance of the Color object as a copy of the specified color
Public methodColor(Single, Single, Single, Single)
Initializes a new instance of the Color object with the specified red, green, blue, and alpha components
Public methodColor(Object, Single, Single, Single, Single)
Initializes a new instance of the Color struct with the specified native control object.
Top
Properties
  NameDescription
Public propertyA
Gets or sets the alpha/opacity (0-1)
Public propertyAb
Gets or sets the alpha/opacity component as a byte of a 32-bit color (0-255)
Public propertyB
Gets or sets the blue (0-1)
Public propertyBb
Gets or sets the blue component as a byte of a 32-bit color (0-255)
Public propertyControlObject
Gets the native color control object.
Public propertyG
Gets or sets the green (0-1)
Public propertyGb
Gets or sets the green component as a byte of a 32-bit color (0-255)
Public propertyR
Gets or sets the red component (0-1)
Public propertyRb
Gets or sets the red component as a byte of a 32-bit color (0-255)
Top
Methods
  NameDescription
Public methodStatic memberBlend(Color, Color)
Blends the blendColor onto the specified baseColor. Uses alpha component of blendColor to detemine the blending factor.
Public methodStatic memberBlend(Color, Color, Single)
Blends the blendColor onto the specified baseColor. Ignores the alpha component and uses the provided blend factor.
Public methodStatic memberDistance
Calculates the distance of the two colors in the RGB scale
Public methodEquals(Object)
Tests if the specified object has the same value as this Color
(Overrides ValueTypeEquals(Object).)
Public methodEquals(Color)
Compares the specified color for equality
Public methodStatic memberFromArgb(Int32)
Creates a Color from a 32-bit ARGB value
Public methodStatic memberFromArgb(Int32, Int32, Int32, Int32)
Creates a color from 8-bit ARGB components
Public methodStatic memberFromElementId
Creates a new color from an Element ID value
Public methodStatic memberFromGrayscale
Creates a Color with a specified value for the Red, Green, and Blue components
Public methodStatic memberFromRgb
Creates a Color from a 24-bit RGB value
Public methodGetHashCode
Gets the hash code for this Color
(Overrides ValueTypeGetHashCode.)
Public methodInvert
Inverts the RGB color values
Public methodStatic memberParse
Converts a string into a new instance of a Color
Public methodToArgb
Converts this color to a 32-bit ARGB value.
Public methodToCMYK
Converts this RGB color to the CMYK colorspace.
Public methodToElementId
Converts this color to an Element ID value
Public methodToHex
Converts this color to a hex representation
Public methodToHSB
Converts this RGB color to the HSB colorspace.
Public methodToHSL
Converts this RGB color to the HSL colorspace.
Public methodToString
Converts this object to a string
(Overrides ValueTypeToString.)
Public methodStatic memberTryParse
Converts the specified string to a color
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Compares two Color structs for equality
Public operatorStatic memberInequality
Compares two Color structs for inequality
Top
See Also