[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.ColorF

Struct ColorF

Namespace
GrapeCity.Documents.DX
Assembly
GcDocs.DX.Windows.dll

Represents a color in the form of rgba.

public struct ColorF : IEquatable<ColorF>, IFormattable
Implements
System.IEquatable<T><ColorF>
System.IFormattable
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()

Constructors

ColorF(ColorF, float)

Initializes a new instance of the ColorF struct.

public ColorF(ColorF value, float alpha = 1)

Parameters

value ColorF

The source ColorF.

alpha float

The alpha component of the color.

ColorF(Vector3, float)

Initializes a new instance of the ColorF struct.

public ColorF(Vector3 value, float alpha = 1)

Parameters

value Vector3

The red, green, and blue components of the color.

alpha float

The alpha component of the color.

ColorF(Vector4)

Initializes a new instance of the ColorF struct.

public ColorF(Vector4 value)

Parameters

value Vector4

The red, green, blue, and alpha components of the color.

ColorF(Color)

Initializes a new instance of the ColorF struct.

public ColorF(Color color)

Parameters

color System.Drawing.Color

The System.Drawing.Color value.

ColorF(float, float, float, float)

Initializes a new instance of the ColorF struct.

public ColorF(float red, float green, float blue, float alpha = 1)

Parameters

red float

The red component of the color.

green float

The green component of the color.

blue float

The blue component of the color.

alpha float

The alpha component of the color.

ColorF(float)

Initializes a new instance of the ColorF struct.

public ColorF(float value)

Parameters

value float

The value that will be assigned to all components.

ColorF(float[])

Initializes a new instance of the ColorF struct.

public ColorF(float[] values)

Parameters

values float[]

The values to assign to the red, green, blue, and alpha components of the color. This must be an array with four elements.

Exceptions

System.ArgumentNullException

Thrown when values is null.

System.ArgumentOutOfRangeException

Thrown when values contains more or less than four elements.

ColorF(uint, float)

Initializes a new instance of the ColorF struct.

[CLSCompliant(false)]
public ColorF(uint rgb, float alpha)

Parameters

rgb uint

A packed unsigned integer containing three color components in RGB order.

alpha float

The alpha component of the color.

ColorF(uint)

Initializes a new instance of the ColorF struct.

[CLSCompliant(false)]
public ColorF(uint argb)

Parameters

argb uint

A packed unsigned integer containing all four color components in ARGB order.

Fields

A

The alpha component of the color.

public float A

Field Value

float

AliceBlue

AliceBlue color.

public static readonly ColorF AliceBlue

Field Value

ColorF

AntiqueWhite

AntiqueWhite color.

public static readonly ColorF AntiqueWhite

Field Value

ColorF

Aqua

Aqua color.

public static readonly ColorF Aqua

Field Value

ColorF

Aquamarine

Aquamarine color.

public static readonly ColorF Aquamarine

Field Value

ColorF

Azure

Azure color.

public static readonly ColorF Azure

Field Value

ColorF

B

The blue component of the color.

public float B

Field Value

float

Beige

Beige color.

public static readonly ColorF Beige

Field Value

ColorF

Bisque

Bisque color.

public static readonly ColorF Bisque

Field Value

ColorF

Black

Black color.

public static readonly ColorF Black

Field Value

ColorF

BlanchedAlmond

BlanchedAlmond color.

public static readonly ColorF BlanchedAlmond

Field Value

ColorF

Blue

Blue color.

public static readonly ColorF Blue

Field Value

ColorF

BlueViolet

BlueViolet color.

public static readonly ColorF BlueViolet

Field Value

ColorF

Brown

Brown color.

public static readonly ColorF Brown

Field Value

ColorF

BurlyWood

BurlyWood color.

public static readonly ColorF BurlyWood

Field Value

ColorF

CadetBlue

CadetBlue color.

public static readonly ColorF CadetBlue

Field Value

ColorF

Chartreuse

Chartreuse color.

public static readonly ColorF Chartreuse

Field Value

ColorF

Chocolate

Chocolate color.

public static readonly ColorF Chocolate

Field Value

ColorF

Coral

Coral color.

public static readonly ColorF Coral

Field Value

ColorF

CornflowerBlue

CornflowerBlue color.

public static readonly ColorF CornflowerBlue

Field Value

ColorF

Cornsilk

Cornsilk color.

public static readonly ColorF Cornsilk

Field Value

ColorF

Crimson

Crimson color.

public static readonly ColorF Crimson

Field Value

ColorF

Cyan

Cyan color.

public static readonly ColorF Cyan

Field Value

ColorF

DarkBlue

DarkBlue color.

public static readonly ColorF DarkBlue

Field Value

ColorF

DarkCyan

DarkCyan color.

public static readonly ColorF DarkCyan

Field Value

ColorF

DarkGoldenrod

DarkGoldenrod color.

public static readonly ColorF DarkGoldenrod

Field Value

ColorF

DarkGray

DarkGray color.

public static readonly ColorF DarkGray

Field Value

ColorF

DarkGreen

DarkGreen color.

public static readonly ColorF DarkGreen

Field Value

ColorF

DarkKhaki

DarkKhaki color.

public static readonly ColorF DarkKhaki

Field Value

ColorF

DarkMagenta

DarkMagenta color.

public static readonly ColorF DarkMagenta

Field Value

ColorF

DarkOliveGreen

DarkOliveGreen color.

public static readonly ColorF DarkOliveGreen

Field Value

ColorF

DarkOrange

DarkOrange color.

public static readonly ColorF DarkOrange

Field Value

ColorF

DarkOrchid

DarkOrchid color.

public static readonly ColorF DarkOrchid

Field Value

ColorF

DarkRed

DarkRed color.

public static readonly ColorF DarkRed

Field Value

ColorF

DarkSalmon

DarkSalmon color.

public static readonly ColorF DarkSalmon

Field Value

ColorF

DarkSeaGreen

DarkSeaGreen color.

public static readonly ColorF DarkSeaGreen

Field Value

ColorF

DarkSlateBlue

DarkSlateBlue color.

public static readonly ColorF DarkSlateBlue

Field Value

ColorF

DarkSlateGray

DarkSlateGray color.

public static readonly ColorF DarkSlateGray

Field Value

ColorF

DarkTurquoise

DarkTurquoise color.

public static readonly ColorF DarkTurquoise

Field Value

ColorF

DarkViolet

DarkViolet color.

public static readonly ColorF DarkViolet

Field Value

ColorF

DeepPink

DeepPink color.

public static readonly ColorF DeepPink

Field Value

ColorF

DeepSkyBlue

DeepSkyBlue color.

public static readonly ColorF DeepSkyBlue

Field Value

ColorF

DimGray

DimGray color.

public static readonly ColorF DimGray

Field Value

ColorF

DodgerBlue

DodgerBlue color.

public static readonly ColorF DodgerBlue

Field Value

ColorF

Empty

Empty color.

public static readonly ColorF Empty

Field Value

ColorF

Firebrick

Firebrick color.

public static readonly ColorF Firebrick

Field Value

ColorF

FloralWhite

FloralWhite color.

public static readonly ColorF FloralWhite

Field Value

ColorF

ForestGreen

ForestGreen color.

public static readonly ColorF ForestGreen

Field Value

ColorF

Fuchsia

Fuchsia color.

public static readonly ColorF Fuchsia

Field Value

ColorF

G

The green component of the color.

public float G

Field Value

float

Gainsboro

Gainsboro color.

public static readonly ColorF Gainsboro

Field Value

ColorF

GhostWhite

GhostWhite color.

public static readonly ColorF GhostWhite

Field Value

ColorF

Gold

Gold color.

public static readonly ColorF Gold

Field Value

ColorF

Goldenrod

Goldenrod color.

public static readonly ColorF Goldenrod

Field Value

ColorF

Gray

Gray color.

public static readonly ColorF Gray

Field Value

ColorF

Green

Green color.

public static readonly ColorF Green

Field Value

ColorF

GreenYellow

GreenYellow color.

public static readonly ColorF GreenYellow

Field Value

ColorF

Honeydew

Honeydew color.

public static readonly ColorF Honeydew

Field Value

ColorF

HotPink

HotPink color.

public static readonly ColorF HotPink

Field Value

ColorF

IndianRed

IndianRed color.

public static readonly ColorF IndianRed

Field Value

ColorF

Indigo

Indigo color.

public static readonly ColorF Indigo

Field Value

ColorF

Ivory

Ivory color.

public static readonly ColorF Ivory

Field Value

ColorF

Khaki

Khaki color.

public static readonly ColorF Khaki

Field Value

ColorF

Lavender

Lavender color.

public static readonly ColorF Lavender

Field Value

ColorF

LavenderBlush

LavenderBlush color.

public static readonly ColorF LavenderBlush

Field Value

ColorF

LawnGreen

LawnGreen color.

public static readonly ColorF LawnGreen

Field Value

ColorF

LemonChiffon

LemonChiffon color.

public static readonly ColorF LemonChiffon

Field Value

ColorF

LightBlue

LightBlue color.

public static readonly ColorF LightBlue

Field Value

ColorF

LightCoral

LightCoral color.

public static readonly ColorF LightCoral

Field Value

ColorF

LightCyan

LightCyan color.

public static readonly ColorF LightCyan

Field Value

ColorF

LightGoldenrodYellow

LightGoldenrodYellow color.

public static readonly ColorF LightGoldenrodYellow

Field Value

ColorF

LightGray

LightGray color.

public static readonly ColorF LightGray

Field Value

ColorF

LightGreen

LightGreen color.

public static readonly ColorF LightGreen

Field Value

ColorF

LightPink

LightPink color.

public static readonly ColorF LightPink

Field Value

ColorF

LightSalmon

LightSalmon color.

public static readonly ColorF LightSalmon

Field Value

ColorF

LightSeaGreen

LightSeaGreen color.

public static readonly ColorF LightSeaGreen

Field Value

ColorF

LightSkyBlue

LightSkyBlue color.

public static readonly ColorF LightSkyBlue

Field Value

ColorF

LightSlateGray

LightSlateGray color.

public static readonly ColorF LightSlateGray

Field Value

ColorF

LightSteelBlue

LightSteelBlue color.

public static readonly ColorF LightSteelBlue

Field Value

ColorF

LightYellow

LightYellow color.

public static readonly ColorF LightYellow

Field Value

ColorF

Lime

Lime color.

public static readonly ColorF Lime

Field Value

ColorF

LimeGreen

LimeGreen color.

public static readonly ColorF LimeGreen

Field Value

ColorF

Linen

Linen color.

public static readonly ColorF Linen

Field Value

ColorF

Magenta

Magenta color.

public static readonly ColorF Magenta

Field Value

ColorF

Maroon

Maroon color.

public static readonly ColorF Maroon

Field Value

ColorF

MediumAquamarine

MediumAquamarine color.

public static readonly ColorF MediumAquamarine

Field Value

ColorF

MediumBlue

MediumBlue color.

public static readonly ColorF MediumBlue

Field Value

ColorF

MediumOrchid

MediumOrchid color.

public static readonly ColorF MediumOrchid

Field Value

ColorF

MediumPurple

MediumPurple color.

public static readonly ColorF MediumPurple

Field Value

ColorF

MediumSeaGreen

MediumSeaGreen color.

public static readonly ColorF MediumSeaGreen

Field Value

ColorF

MediumSlateBlue

MediumSlateBlue color.

public static readonly ColorF MediumSlateBlue

Field Value

ColorF

MediumSpringGreen

MediumSpringGreen color.

public static readonly ColorF MediumSpringGreen

Field Value

ColorF

MediumTurquoise

MediumTurquoise color.

public static readonly ColorF MediumTurquoise

Field Value

ColorF

MediumVioletRed

MediumVioletRed color.

public static readonly ColorF MediumVioletRed

Field Value

ColorF

MidnightBlue

MidnightBlue color.

public static readonly ColorF MidnightBlue

Field Value

ColorF

MintCream

MintCream color.

public static readonly ColorF MintCream

Field Value

ColorF

MistyRose

MistyRose color.

public static readonly ColorF MistyRose

Field Value

ColorF

Moccasin

Moccasin color.

public static readonly ColorF Moccasin

Field Value

ColorF

NavajoWhite

NavajoWhite color.

public static readonly ColorF NavajoWhite

Field Value

ColorF

Navy

Navy color.

public static readonly ColorF Navy

Field Value

ColorF

OldLace

OldLace color.

public static readonly ColorF OldLace

Field Value

ColorF

Olive

Olive color.

public static readonly ColorF Olive

Field Value

ColorF

OliveDrab

OliveDrab color.

public static readonly ColorF OliveDrab

Field Value

ColorF

Orange

Orange color.

public static readonly ColorF Orange

Field Value

ColorF

OrangeRed

OrangeRed color.

public static readonly ColorF OrangeRed

Field Value

ColorF

Orchid

Orchid color.

public static readonly ColorF Orchid

Field Value

ColorF

PaleGoldenrod

PaleGoldenrod color.

public static readonly ColorF PaleGoldenrod

Field Value

ColorF

PaleGreen

PaleGreen color.

public static readonly ColorF PaleGreen

Field Value

ColorF

PaleTurquoise

PaleTurquoise color.

public static readonly ColorF PaleTurquoise

Field Value

ColorF

PaleVioletRed

PaleVioletRed color.

public static readonly ColorF PaleVioletRed

Field Value

ColorF

PapayaWhip

PapayaWhip color.

public static readonly ColorF PapayaWhip

Field Value

ColorF

PeachPuff

PeachPuff color.

public static readonly ColorF PeachPuff

Field Value

ColorF

Peru

Peru color.

public static readonly ColorF Peru

Field Value

ColorF

Pink

Pink color.

public static readonly ColorF Pink

Field Value

ColorF

Plum

Plum color.

public static readonly ColorF Plum

Field Value

ColorF

PowderBlue

PowderBlue color.

public static readonly ColorF PowderBlue

Field Value

ColorF

Purple

Purple color.

public static readonly ColorF Purple

Field Value

ColorF

R

The red component of the color.

public float R

Field Value

float

Red

Red color.

public static readonly ColorF Red

Field Value

ColorF

RosyBrown

RosyBrown color.

public static readonly ColorF RosyBrown

Field Value

ColorF

RoyalBlue

RoyalBlue color.

public static readonly ColorF RoyalBlue

Field Value

ColorF

SaddleBrown

SaddleBrown color.

public static readonly ColorF SaddleBrown

Field Value

ColorF

Salmon

Salmon color.

public static readonly ColorF Salmon

Field Value

ColorF

SandyBrown

SandyBrown color.

public static readonly ColorF SandyBrown

Field Value

ColorF

SeaGreen

SeaGreen color.

public static readonly ColorF SeaGreen

Field Value

ColorF

SeaShell

SeaShell color.

public static readonly ColorF SeaShell

Field Value

ColorF

Sienna

Sienna color.

public static readonly ColorF Sienna

Field Value

ColorF

Silver

Silver color.

public static readonly ColorF Silver

Field Value

ColorF

SizeInBytes

The size of the ColorF type, in bytes.

public const int SizeInBytes = 16

Field Value

int

SkyBlue

SkyBlue color.

public static readonly ColorF SkyBlue

Field Value

ColorF

SlateBlue

SlateBlue color.

public static readonly ColorF SlateBlue

Field Value

ColorF

SlateGray

SlateGray color.

public static readonly ColorF SlateGray

Field Value

ColorF

Snow

Snow color.

public static readonly ColorF Snow

Field Value

ColorF

SpringGreen

SpringGreen color.

public static readonly ColorF SpringGreen

Field Value

ColorF

SteelBlue

SteelBlue color.

public static readonly ColorF SteelBlue

Field Value

ColorF

Tan

Tan color.

public static readonly ColorF Tan

Field Value

ColorF

Teal

Teal color.

public static readonly ColorF Teal

Field Value

ColorF

Thistle

Thistle color.

public static readonly ColorF Thistle

Field Value

ColorF

Tomato

Tomato color.

public static readonly ColorF Tomato

Field Value

ColorF

Transparent

Transparent color.

public static readonly ColorF Transparent

Field Value

ColorF

Turquoise

Turquoise color.

public static readonly ColorF Turquoise

Field Value

ColorF

Violet

Violet color.

public static readonly ColorF Violet

Field Value

ColorF

Wheat

Wheat color.

public static readonly ColorF Wheat

Field Value

ColorF

White

White color.

public static readonly ColorF White

Field Value

ColorF

WhiteSmoke

WhiteSmoke color.

public static readonly ColorF WhiteSmoke

Field Value

ColorF

Yellow

Yellow color.

public static readonly ColorF Yellow

Field Value

ColorF

YellowGreen

YellowGreen color.

public static readonly ColorF YellowGreen

Field Value

ColorF

Properties

IsEmpty

Gets whether this ColorF structure is uninitialized.

public bool IsEmpty { get; }

Property Value

bool

IsTransparent

Gets a value indicating if we can skip drawing with this color.

public bool IsTransparent { get; }

Property Value

bool

Methods

AdjustContrast(ColorF, float)

Adjusts the contrast of a color.

public static ColorF AdjustContrast(ColorF value, float contrast)

Parameters

value ColorF

The color whose contrast is to be adjusted.

contrast float

The amount by which to adjust the contrast.

Returns

ColorF

The adjusted color.

AdjustSaturation(ColorF, float)

Adjusts the saturation of a color.

public static ColorF AdjustSaturation(ColorF value, float saturation)

Parameters

value ColorF

The color whose saturation is to be adjusted.

saturation float

The amount by which to adjust the saturation.

Returns

ColorF

The adjusted color.

Equals(ColorF)

Determines whether the specified ColorF is equal to this instance.

public bool Equals(ColorF other)

Parameters

other ColorF

Returns

bool

Equals(object)

Determines whether the specified object is equal to this instance.

public override bool Equals(object value)

Parameters

value object

Returns

bool

FromArgb(int, int, int, int)

Creates a ColorF structure from the four ARGB component (alpha, red, green, and blue) values.

public static ColorF FromArgb(int alpha, int red, int green, int blue)

Parameters

alpha int
red int
green int
blue int

Returns

ColorF

FromArgb(int, int, int)

Creates a ColorF structure from the specified 8-bit color values (red, green, and blue). The alpha value is implicitly fully opaque.

public static ColorF FromArgb(int red, int green, int blue)

Parameters

red int
green int
blue int

Returns

ColorF

FromArgb(int)

Converts the color from an ARGB integer.

public static ColorF FromArgb(int argb)

Parameters

argb int

A packed integer containing all four color components in ARGB order

Returns

ColorF

A color.

GetHashCode()

Returns a hash code for this instance.

public override int GetHashCode()

Returns

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Lerp(ColorF, ColorF, float)

Performs a linear interpolation between two colors.

public static ColorF Lerp(ColorF start, ColorF end, float amount)

Parameters

start ColorF

Start color.

end ColorF

End color.

amount float

Value between 0 and 1 indicating the weight of end.

Returns

ColorF

The linear interpolation of the two colors.

Remarks

This method performs the linear interpolation based on the following formula.

start + (end - start) * amount

Passing amount a value of 0 will cause start to be returned; a value of 1 will cause end to be returned.

SmoothStep(ColorF, ColorF, float)

Performs a cubic interpolation between two colors.

public static ColorF SmoothStep(ColorF start, ColorF end, float amount)

Parameters

start ColorF

Start color.

end ColorF

End color.

amount float

Value between 0 and 1 indicating the weight of end.

Returns

ColorF

The cubic interpolation of the two colors.

ToArgb()

Converts the color into a packed integer.

public int ToArgb()

Returns

int

A packed integer containing all four color components.

ToArray()

Creates an array containing the elements of the color.

public float[] ToArray()

Returns

float[]

A four-element array containing the components of the color.

ToColor()

Converts the color into a System.Drawing.Color.

public Color ToColor()

Returns

System.Drawing.Color

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

ToString(IFormatProvider)

Returns a string that represents this instance.

public string ToString(IFormatProvider formatProvider)

Parameters

formatProvider System.IFormatProvider

The format provider.

Returns

string

A string that represents this instance.

ToString(string, IFormatProvider)

Returns a string that represents this instance.

public string ToString(string format, IFormatProvider formatProvider)

Parameters

format string

The format.

formatProvider System.IFormatProvider

The format provider.

Returns

string

A string that represents this instance.

ToString(string)

Returns a string that represents this instance.

public string ToString(string format)

Parameters

format string

The format.

Returns

string

A string that represents this instance.

ToVector3()

Converts the color into a three component vector.

public Vector3 ToVector3()

Returns

Vector3

A three component vector containing the red, green, and blue components of the color.

ToVector4()

Converts the color into a four component vector.

public Vector4 ToVector4()

Returns

Vector4

A four component vector containing all four color components.

Operators

operator ==(ColorF, ColorF)

Determines if the specified values are equal.

public static bool operator ==(ColorF left, ColorF right)

Parameters

left ColorF
right ColorF

Returns

bool

explicit operator Vector3(ColorF)

Performs an explicit conversion from ColorF to Vector3.

public static explicit operator Vector3(ColorF value)

Parameters

value ColorF

The value.

Returns

Vector3

The result of the conversion.

explicit operator Color(ColorF)

Performs an explicit conversion from ColorF to System.Drawing.Color.

public static explicit operator Color(ColorF value)

Parameters

value ColorF

Returns

System.Drawing.Color

explicit operator ColorF(Vector3)

Performs an explicit conversion from Vector3 to ColorF.

public static explicit operator ColorF(Vector3 value)

Parameters

value Vector3

The value.

Returns

ColorF

The result of the conversion.

explicit operator ColorF(Vector4)

Performs an explicit conversion from Vector4 to ColorF.

public static explicit operator ColorF(Vector4 value)

Parameters

value Vector4

The value.

Returns

ColorF

The result of the conversion.

explicit operator ColorF(Color)

Performs an explicit conversion from System.Drawing.Color to ColorF.

public static explicit operator ColorF(Color color)

Parameters

color System.Drawing.Color

Returns

ColorF

implicit operator Vector4(ColorF)

Performs an explicit conversion from ColorF to Vector4.

public static implicit operator Vector4(ColorF value)

Parameters

value ColorF

The value.

Returns

Vector4

The result of the conversion.

operator !=(ColorF, ColorF)

Determines if the specified values are not equal.

public static bool operator !=(ColorF left, ColorF right)

Parameters

left ColorF
right ColorF

Returns

bool