Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    Color Struct

    Namespace: Stride.Core.Mathematics
    Assembly: Stride.Core.Mathematics.dll

    Represents a 32-bit color (4 bytes) in the form of RGBA (in byte order: R, G, B, A).

    [DataContract("Color")]
    [DataStyle(DataStyle.Compact)]
    public struct Color : IEquatable<Color>
    Name Description
    Constructors
    Color(Vector3)

    Initializes a new instance of the Color struct. Alpha is set to 255.

    Color(Vector3, Single)

    Initializes a new instance of the Color struct.

    Color(Vector4)

    Initializes a new instance of the Color struct.

    Color(Byte)

    Initializes a new instance of the Color struct.

    Color(Byte, Byte, Byte)

    Initializes a new instance of the Color struct. Alpha is set to 255.

    Color(Byte, Byte, Byte, Byte)

    Initializes a new instance of the Color struct.

    Color(Byte[])

    Initializes a new instance of the Color struct.

    Color(Int32)

    Initializes a new instance of the Color struct.

    Color(Single)

    Initializes a new instance of the Color struct.

    Color(Single, Single, Single)

    Initializes a new instance of the Color struct. Alpha is set to 255.

    Color(Single, Single, Single, Single)

    Initializes a new instance of the Color struct.

    Color(Single[])

    Initializes a new instance of the Color struct.

    Color(UInt32)

    Initializes a new instance of the Color struct.

    Fields
    A

    The alpha component of the color.

    AliceBlue

    AliceBlue color.

    AntiqueWhite

    AntiqueWhite color.

    Aqua

    Aqua color.

    Aquamarine

    Aquamarine color.

    Azure

    Azure color.

    B

    The blue component of the color.

    Beige

    Beige color.

    Bisque

    Bisque color.

    Black

    Black color.

    BlanchedAlmond

    BlanchedAlmond color.

    Blue

    Blue color.

    BlueViolet

    BlueViolet color.

    Brown

    Brown color.

    BurlyWood

    BurlyWood color.

    CadetBlue

    CadetBlue color.

    Chartreuse

    Chartreuse color.

    Chocolate

    Chocolate color.

    Coral

    Coral color.

    CornflowerBlue

    CornflowerBlue color.

    Cornsilk

    Cornsilk color.

    Crimson

    Crimson color.

    Cyan

    Cyan color.

    DarkBlue

    DarkBlue color.

    DarkCyan

    DarkCyan color.

    DarkGoldenrod

    DarkGoldenrod color.

    DarkGray

    DarkGray color.

    DarkGreen

    DarkGreen color.

    DarkKhaki

    DarkKhaki color.

    DarkMagenta

    DarkMagenta color.

    DarkOliveGreen

    DarkOliveGreen color.

    DarkOrange

    DarkOrange color.

    DarkOrchid

    DarkOrchid color.

    DarkRed

    DarkRed color.

    DarkSalmon

    DarkSalmon color.

    DarkSeaGreen

    DarkSeaGreen color.

    DarkSlateBlue

    DarkSlateBlue color.

    DarkSlateGray

    DarkSlateGray color.

    DarkTurquoise

    DarkTurquoise color.

    DarkViolet

    DarkViolet color.

    DeepPink

    DeepPink color.

    DeepSkyBlue

    DeepSkyBlue color.

    DimGray

    DimGray color.

    DodgerBlue

    DodgerBlue color.

    Firebrick

    Firebrick color.

    FloralWhite

    FloralWhite color.

    ForestGreen

    ForestGreen color.

    Fuchsia

    Fuchsia color.

    G

    The green component of the color.

    Gainsboro

    Gainsboro color.

    GhostWhite

    GhostWhite color.

    Gold

    Gold color.

    Goldenrod

    Goldenrod color.

    Gray

    Gray color.

    Green

    Green color.

    GreenYellow

    GreenYellow color.

    Honeydew

    Honeydew color.

    HotPink

    HotPink color.

    IndianRed

    IndianRed color.

    Indigo

    Indigo color.

    Ivory

    Ivory color.

    Khaki

    Khaki color.

    Lavender

    Lavender color.

    LavenderBlush

    LavenderBlush color.

    LawnGreen

    LawnGreen color.

    LemonChiffon

    LemonChiffon color.

    LightBlue

    LightBlue color.

    LightCoral

    LightCoral color.

    LightCyan

    LightCyan color.

    LightGoldenrodYellow

    LightGoldenrodYellow color.

    LightGray

    LightGray color.

    LightGreen

    LightGreen color.

    LightPink

    LightPink color.

    LightSalmon

    LightSalmon color.

    LightSeaGreen

    LightSeaGreen color.

    LightSkyBlue

    LightSkyBlue color.

    LightSlateGray

    LightSlateGray color.

    LightSteelBlue

    LightSteelBlue color.

    LightYellow

    LightYellow color.

    Lime

    Lime color.

    LimeGreen

    LimeGreen color.

    Linen

    Linen color.

    Magenta

    Magenta color.

    Maroon

    Maroon color.

    MediumAquamarine

    MediumAquamarine color.

    MediumBlue

    MediumBlue color.

    MediumOrchid

    MediumOrchid color.

    MediumPurple

    MediumPurple color.

    MediumSeaGreen

    MediumSeaGreen color.

    MediumSlateBlue

    MediumSlateBlue color.

    MediumSpringGreen

    MediumSpringGreen color.

    MediumTurquoise

    MediumTurquoise color.

    MediumVioletRed

    MediumVioletRed color.

    MidnightBlue

    MidnightBlue color.

    MintCream

    MintCream color.

    MistyRose

    MistyRose color.

    Moccasin

    Moccasin color.

    NavajoWhite

    NavajoWhite color.

    Navy

    Navy color.

    OldLace

    OldLace color.

    Olive

    Olive color.

    OliveDrab

    OliveDrab color.

    Orange

    Orange color.

    OrangeRed

    OrangeRed color.

    Orchid

    Orchid color.

    PaleGoldenrod

    PaleGoldenrod color.

    PaleGreen

    PaleGreen color.

    PaleTurquoise

    PaleTurquoise color.

    PaleVioletRed

    PaleVioletRed color.

    PapayaWhip

    PapayaWhip color.

    PeachPuff

    PeachPuff color.

    Peru

    Peru color.

    Pink

    Pink color.

    Plum

    Plum color.

    PowderBlue

    PowderBlue color.

    Purple

    Purple color.

    R

    The red component of the color.

    Red

    Red color.

    RosyBrown

    RosyBrown color.

    RoyalBlue

    RoyalBlue color.

    SaddleBrown

    SaddleBrown color.

    Salmon

    Salmon color.

    SandyBrown

    SandyBrown color.

    SeaGreen

    SeaGreen color.

    SeaShell

    SeaShell color.

    Sienna

    Sienna color.

    Silver

    Silver color.

    SkyBlue

    SkyBlue color.

    SlateBlue

    SlateBlue color.

    SlateGray

    SlateGray color.

    Snow

    Snow color.

    SpringGreen

    SpringGreen color.

    SteelBlue

    SteelBlue color.

    Tan

    Tan color.

    Teal

    Teal color.

    Thistle

    Thistle color.

    Tomato

    Tomato color.

    Transparent

    Transparent color.

    Turquoise

    Turquoise color.

    VeryDimGray

    VeryDimGray color.

    Violet

    Violet color.

    Wheat

    Wheat color.

    White

    White color.

    WhiteSmoke

    WhiteSmoke color.

    Yellow

    Yellow color.

    YellowGreen

    YellowGreen color.

    Zero

    Zero color.

    Properties
    Item[Int32]

    Gets or sets the component at the specified index.

    Methods
    Add(Color, Color)

    Adds two colors.

    Add(ref Color, ref Color, out Color)

    Adds two colors.

    AdjustContrast(Color, Single)

    Adjusts the contrast of a color.

    AdjustContrast(ref Color, Single, out Color)

    Adjusts the contrast of a color.

    AdjustSaturation(Color, Single)

    Adjusts the saturation of a color.

    AdjustSaturation(ref Color, Single, out Color)

    Adjusts the saturation of a color.

    Clamp(Color, Color, Color)

    Restricts a value to be within a specified range.

    Clamp(ref Color, ref Color, ref Color, out Color)

    Restricts a value to be within a specified range.

    Equals(Color)

    Determines whether the specified Color is equal to this instance.

    Equals(Object)

    Determines whether the specified System.Object is equal to this instance.

    FromAbgr(Int32)

    Converts the color from a packed ABGR integer.

    FromAbgr(UInt32)

    Converts the color from a packed ABGR integer.

    FromBgra(Int32)

    Converts the color from a packed BGRA integer.

    FromBgra(UInt32)

    Converts the color from a packed BGRA integer.

    FromRgba(Int32)

    Converts the color from a packed RGBA integer.

    FromRgba(UInt32)

    Converts the color from a packed RGBA integer.

    GetBrightness()

    Gets the brightness.

    GetHashCode()

    Returns a hash code for this instance.

    GetHue()

    Gets the hue.

    GetSaturation()

    Gets the saturation.

    Lerp(Color, Color, Single)

    Performs a linear interpolation between two colors.

    Lerp(ref Color, ref Color, Single, out Color)

    Performs a linear interpolation between two colors.

    Max(Color, Color)

    Returns a color containing the largest components of the specified colorss.

    Max(ref Color, ref Color, out Color)

    Returns a color containing the smallest components of the specified colors.

    Min(Color, Color)

    Returns a color containing the smallest components of the specified colors.

    Min(ref Color, ref Color, out Color)

    Returns a color containing the smallest components of the specified colors.

    Modulate(Color, Color)

    Modulates two colors.

    Modulate(ref Color, ref Color, out Color)

    Modulates two colors.

    Negate(Color)

    Negates a color.

    Negate(ref Color, out Color)

    Negates a color.

    Scale(Color, Single)

    Scales a color.

    Scale(ref Color, Single, out Color)

    Scales a color.

    SmoothStep(Color, Color, Single)

    Performs a cubic interpolation between two colors.

    SmoothStep(ref Color, ref Color, Single, out Color)

    Performs a cubic interpolation between two colors.

    Subtract(Color, Color)

    Subtracts two colors.

    Subtract(ref Color, ref Color, out Color)

    Subtracts two colors.

    ToAbgr()

    Converts the color into a packed integer.

    ToArgb()

    Converts the color into a packed integer.

    ToArray()

    Creates an array containing the elements of the color.

    ToBgra()

    Converts the color into a packed integer.

    ToColor3()

    Converts the color into a three component color.

    ToColor4()

    Convert this instance to a Color4

    ToRgba()

    Converts the color into a packed integer.

    ToString()

    Returns a System.String that represents this instance.

    ToVector3()

    Converts the color into a three component vector.

    ToVector4()

    Converts the color into a four component vector.

    Operators
    Addition(Color, Color)

    Adds two colors.

    Equality(Color, Color)

    Tests for equality between two objects.

    Explicit(Color to Color3)

    Performs an explicit conversion from Color to Color3.

    Explicit(Color to Vector3)

    Performs an explicit conversion from Color to Vector3.

    Explicit(Color to Vector4)

    Performs an explicit conversion from Color to Vector4.

    Explicit(Color to Int32)

    Performs an explicit conversion from System.Int32 to Color.

    Explicit(Color3 to Color)

    Performs an explicit conversion from Color3 to Color.

    Explicit(Color4 to Color)

    Performs an explicit conversion from Color4 to Color.

    Explicit(Vector3 to Color)

    Performs an explicit conversion from Vector3 to Color.

    Explicit(Vector4 to Color)

    Performs an explicit conversion from Vector4 to Color.

    Explicit(Int32 to Color)

    Performs an explicit conversion from System.Int32 to Color.

    Implicit(Color to Color4)

    Performs an implicit conversion from Color to Color4.

    Inequality(Color, Color)

    Tests for inequality between two objects.

    Multiply(Color, Color)

    Modulates two colors.

    Multiply(Color, Single)

    Scales a color.

    Multiply(Single, Color)

    Scales a color.

    Subtraction(Color, Color)

    Subtracts two colors.

    UnaryNegation(Color)

    Negates a color.

    UnaryPlus(Color)

    Assert a color (return it unchanged).

    | Improve this Doc View Source

    Constructors


    Color(Vector3)

    Initializes a new instance of the Color struct. Alpha is set to 255.

    public Color(Vector3 value)
    Parameters
    Type Name Description
    Vector3 value

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


    Color(Vector3, Single)

    Initializes a new instance of the Color struct.

    public Color(Vector3 value, float alpha)
    Parameters
    Type Name Description
    Vector3 value

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

    System.Single alpha

    The alpha component of the color.


    Color(Vector4)

    Initializes a new instance of the Color struct.

    public Color(Vector4 value)
    Parameters
    Type Name Description
    Vector4 value

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


    Color(Byte)

    Initializes a new instance of the Color struct.

    public Color(byte value)
    Parameters
    Type Name Description
    System.Byte value

    The value that will be assigned to all components.


    Color(Byte, Byte, Byte)

    Initializes a new instance of the Color struct. Alpha is set to 255.

    public Color(byte red, byte green, byte blue)
    Parameters
    Type Name Description
    System.Byte red

    The red component of the color.

    System.Byte green

    The green component of the color.

    System.Byte blue

    The blue component of the color.


    Color(Byte, Byte, Byte, Byte)

    Initializes a new instance of the Color struct.

    public Color(byte red, byte green, byte blue, byte alpha)
    Parameters
    Type Name Description
    System.Byte red

    The red component of the color.

    System.Byte green

    The green component of the color.

    System.Byte blue

    The blue component of the color.

    System.Byte alpha

    The alpha component of the color.


    Color(Byte[])

    Initializes a new instance of the Color struct.

    public Color(byte[] values)
    Parameters
    Type Name Description
    System.Byte[] values

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

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when values is null.

    System.ArgumentOutOfRangeException

    Thrown when values contains more or less than four elements.


    Color(Int32)

    Initializes a new instance of the Color struct.

    public Color(int rgba)
    Parameters
    Type Name Description
    System.Int32 rgba

    A packed integer containing all four color components in RGBA order.


    Color(Single)

    Initializes a new instance of the Color struct.

    public Color(float value)
    Parameters
    Type Name Description
    System.Single value

    The value that will be assigned to all components.


    Color(Single, Single, Single)

    Initializes a new instance of the Color struct. Alpha is set to 255.

    public Color(float red, float green, float blue)
    Parameters
    Type Name Description
    System.Single red

    The red component of the color.

    System.Single green

    The green component of the color.

    System.Single blue

    The blue component of the color.


    Color(Single, Single, Single, Single)

    Initializes a new instance of the Color struct.

    public Color(float red, float green, float blue, float alpha)
    Parameters
    Type Name Description
    System.Single red

    The red component of the color.

    System.Single green

    The green component of the color.

    System.Single blue

    The blue component of the color.

    System.Single alpha

    The alpha component of the color.


    Color(Single[])

    Initializes a new instance of the Color struct.

    public Color(float[] values)
    Parameters
    Type Name Description
    System.Single[] values

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

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when values is null.

    System.ArgumentOutOfRangeException

    Thrown when values contains more or less than four elements.


    Color(UInt32)

    Initializes a new instance of the Color struct.

    public Color(uint rgba)
    Parameters
    Type Name Description
    System.UInt32 rgba

    A packed integer containing all four color components in RGBA order.

    | Improve this Doc View Source

    Fields


    A

    The alpha component of the color.

    [DataMember(3)]
    public byte A
    Field Value
    Type Description
    System.Byte

    AliceBlue

    AliceBlue color.

    public static readonly Color AliceBlue
    Field Value
    Type Description
    Color

    AntiqueWhite

    AntiqueWhite color.

    public static readonly Color AntiqueWhite
    Field Value
    Type Description
    Color

    Aqua

    Aqua color.

    public static readonly Color Aqua
    Field Value
    Type Description
    Color

    Aquamarine

    Aquamarine color.

    public static readonly Color Aquamarine
    Field Value
    Type Description
    Color

    Azure

    Azure color.

    public static readonly Color Azure
    Field Value
    Type Description
    Color

    B

    The blue component of the color.

    [DataMember(2)]
    public byte B
    Field Value
    Type Description
    System.Byte

    Beige

    Beige color.

    public static readonly Color Beige
    Field Value
    Type Description
    Color

    Bisque

    Bisque color.

    public static readonly Color Bisque
    Field Value
    Type Description
    Color

    Black

    Black color.

    public static readonly Color Black
    Field Value
    Type Description
    Color

    BlanchedAlmond

    BlanchedAlmond color.

    public static readonly Color BlanchedAlmond
    Field Value
    Type Description
    Color

    Blue

    Blue color.

    public static readonly Color Blue
    Field Value
    Type Description
    Color

    BlueViolet

    BlueViolet color.

    public static readonly Color BlueViolet
    Field Value
    Type Description
    Color

    Brown

    Brown color.

    public static readonly Color Brown
    Field Value
    Type Description
    Color

    BurlyWood

    BurlyWood color.

    public static readonly Color BurlyWood
    Field Value
    Type Description
    Color

    CadetBlue

    CadetBlue color.

    public static readonly Color CadetBlue
    Field Value
    Type Description
    Color

    Chartreuse

    Chartreuse color.

    public static readonly Color Chartreuse
    Field Value
    Type Description
    Color

    Chocolate

    Chocolate color.

    public static readonly Color Chocolate
    Field Value
    Type Description
    Color

    Coral

    Coral color.

    public static readonly Color Coral
    Field Value
    Type Description
    Color

    CornflowerBlue

    CornflowerBlue color.

    public static readonly Color CornflowerBlue
    Field Value
    Type Description
    Color

    Cornsilk

    Cornsilk color.

    public static readonly Color Cornsilk
    Field Value
    Type Description
    Color

    Crimson

    Crimson color.

    public static readonly Color Crimson
    Field Value
    Type Description
    Color

    Cyan

    Cyan color.

    public static readonly Color Cyan
    Field Value
    Type Description
    Color

    DarkBlue

    DarkBlue color.

    public static readonly Color DarkBlue
    Field Value
    Type Description
    Color

    DarkCyan

    DarkCyan color.

    public static readonly Color DarkCyan
    Field Value
    Type Description
    Color

    DarkGoldenrod

    DarkGoldenrod color.

    public static readonly Color DarkGoldenrod
    Field Value
    Type Description
    Color

    DarkGray

    DarkGray color.

    public static readonly Color DarkGray
    Field Value
    Type Description
    Color

    DarkGreen

    DarkGreen color.

    public static readonly Color DarkGreen
    Field Value
    Type Description
    Color

    DarkKhaki

    DarkKhaki color.

    public static readonly Color DarkKhaki
    Field Value
    Type Description
    Color

    DarkMagenta

    DarkMagenta color.

    public static readonly Color DarkMagenta
    Field Value
    Type Description
    Color

    DarkOliveGreen

    DarkOliveGreen color.

    public static readonly Color DarkOliveGreen
    Field Value
    Type Description
    Color

    DarkOrange

    DarkOrange color.

    public static readonly Color DarkOrange
    Field Value
    Type Description
    Color

    DarkOrchid

    DarkOrchid color.

    public static readonly Color DarkOrchid
    Field Value
    Type Description
    Color

    DarkRed

    DarkRed color.

    public static readonly Color DarkRed
    Field Value
    Type Description
    Color

    DarkSalmon

    DarkSalmon color.

    public static readonly Color DarkSalmon
    Field Value
    Type Description
    Color

    DarkSeaGreen

    DarkSeaGreen color.

    public static readonly Color DarkSeaGreen
    Field Value
    Type Description
    Color

    DarkSlateBlue

    DarkSlateBlue color.

    public static readonly Color DarkSlateBlue
    Field Value
    Type Description
    Color

    DarkSlateGray

    DarkSlateGray color.

    public static readonly Color DarkSlateGray
    Field Value
    Type Description
    Color

    DarkTurquoise

    DarkTurquoise color.

    public static readonly Color DarkTurquoise
    Field Value
    Type Description
    Color

    DarkViolet

    DarkViolet color.

    public static readonly Color DarkViolet
    Field Value
    Type Description
    Color

    DeepPink

    DeepPink color.

    public static readonly Color DeepPink
    Field Value
    Type Description
    Color

    DeepSkyBlue

    DeepSkyBlue color.

    public static readonly Color DeepSkyBlue
    Field Value
    Type Description
    Color

    DimGray

    DimGray color.

    public static readonly Color DimGray
    Field Value
    Type Description
    Color

    DodgerBlue

    DodgerBlue color.

    public static readonly Color DodgerBlue
    Field Value
    Type Description
    Color

    Firebrick

    Firebrick color.

    public static readonly Color Firebrick
    Field Value
    Type Description
    Color

    FloralWhite

    FloralWhite color.

    public static readonly Color FloralWhite
    Field Value
    Type Description
    Color

    ForestGreen

    ForestGreen color.

    public static readonly Color ForestGreen
    Field Value
    Type Description
    Color

    Fuchsia

    Fuchsia color.

    public static readonly Color Fuchsia
    Field Value
    Type Description
    Color

    G

    The green component of the color.

    [DataMember(1)]
    public byte G
    Field Value
    Type Description
    System.Byte

    Gainsboro

    Gainsboro color.

    public static readonly Color Gainsboro
    Field Value
    Type Description
    Color

    GhostWhite

    GhostWhite color.

    public static readonly Color GhostWhite
    Field Value
    Type Description
    Color

    Gold

    Gold color.

    public static readonly Color Gold
    Field Value
    Type Description
    Color

    Goldenrod

    Goldenrod color.

    public static readonly Color Goldenrod
    Field Value
    Type Description
    Color

    Gray

    Gray color.

    public static readonly Color Gray
    Field Value
    Type Description
    Color

    Green

    Green color.

    public static readonly Color Green
    Field Value
    Type Description
    Color

    GreenYellow

    GreenYellow color.

    public static readonly Color GreenYellow
    Field Value
    Type Description
    Color

    Honeydew

    Honeydew color.

    public static readonly Color Honeydew
    Field Value
    Type Description
    Color

    HotPink

    HotPink color.

    public static readonly Color HotPink
    Field Value
    Type Description
    Color

    IndianRed

    IndianRed color.

    public static readonly Color IndianRed
    Field Value
    Type Description
    Color

    Indigo

    Indigo color.

    public static readonly Color Indigo
    Field Value
    Type Description
    Color

    Ivory

    Ivory color.

    public static readonly Color Ivory
    Field Value
    Type Description
    Color

    Khaki

    Khaki color.

    public static readonly Color Khaki
    Field Value
    Type Description
    Color

    Lavender

    Lavender color.

    public static readonly Color Lavender
    Field Value
    Type Description
    Color

    LavenderBlush

    LavenderBlush color.

    public static readonly Color LavenderBlush
    Field Value
    Type Description
    Color

    LawnGreen

    LawnGreen color.

    public static readonly Color LawnGreen
    Field Value
    Type Description
    Color

    LemonChiffon

    LemonChiffon color.

    public static readonly Color LemonChiffon
    Field Value
    Type Description
    Color

    LightBlue

    LightBlue color.

    public static readonly Color LightBlue
    Field Value
    Type Description
    Color

    LightCoral

    LightCoral color.

    public static readonly Color LightCoral
    Field Value
    Type Description
    Color

    LightCyan

    LightCyan color.

    public static readonly Color LightCyan
    Field Value
    Type Description
    Color

    LightGoldenrodYellow

    LightGoldenrodYellow color.

    public static readonly Color LightGoldenrodYellow
    Field Value
    Type Description
    Color

    LightGray

    LightGray color.

    public static readonly Color LightGray
    Field Value
    Type Description
    Color

    LightGreen

    LightGreen color.

    public static readonly Color LightGreen
    Field Value
    Type Description
    Color

    LightPink

    LightPink color.

    public static readonly Color LightPink
    Field Value
    Type Description
    Color

    LightSalmon

    LightSalmon color.

    public static readonly Color LightSalmon
    Field Value
    Type Description
    Color

    LightSeaGreen

    LightSeaGreen color.

    public static readonly Color LightSeaGreen
    Field Value
    Type Description
    Color

    LightSkyBlue

    LightSkyBlue color.

    public static readonly Color LightSkyBlue
    Field Value
    Type Description
    Color

    LightSlateGray

    LightSlateGray color.

    public static readonly Color LightSlateGray
    Field Value
    Type Description
    Color

    LightSteelBlue

    LightSteelBlue color.

    public static readonly Color LightSteelBlue
    Field Value
    Type Description
    Color

    LightYellow

    LightYellow color.

    public static readonly Color LightYellow
    Field Value
    Type Description
    Color

    Lime

    Lime color.

    public static readonly Color Lime
    Field Value
    Type Description
    Color

    LimeGreen

    LimeGreen color.

    public static readonly Color LimeGreen
    Field Value
    Type Description
    Color

    Linen

    Linen color.

    public static readonly Color Linen
    Field Value
    Type Description
    Color

    Magenta

    Magenta color.

    public static readonly Color Magenta
    Field Value
    Type Description
    Color

    Maroon

    Maroon color.

    public static readonly Color Maroon
    Field Value
    Type Description
    Color

    MediumAquamarine

    MediumAquamarine color.

    public static readonly Color MediumAquamarine
    Field Value
    Type Description
    Color

    MediumBlue

    MediumBlue color.

    public static readonly Color MediumBlue
    Field Value
    Type Description
    Color

    MediumOrchid

    MediumOrchid color.

    public static readonly Color MediumOrchid
    Field Value
    Type Description
    Color

    MediumPurple

    MediumPurple color.

    public static readonly Color MediumPurple
    Field Value
    Type Description
    Color

    MediumSeaGreen

    MediumSeaGreen color.

    public static readonly Color MediumSeaGreen
    Field Value
    Type Description
    Color

    MediumSlateBlue

    MediumSlateBlue color.

    public static readonly Color MediumSlateBlue
    Field Value
    Type Description
    Color

    MediumSpringGreen

    MediumSpringGreen color.

    public static readonly Color MediumSpringGreen
    Field Value
    Type Description
    Color

    MediumTurquoise

    MediumTurquoise color.

    public static readonly Color MediumTurquoise
    Field Value
    Type Description
    Color

    MediumVioletRed

    MediumVioletRed color.

    public static readonly Color MediumVioletRed
    Field Value
    Type Description
    Color

    MidnightBlue

    MidnightBlue color.

    public static readonly Color MidnightBlue
    Field Value
    Type Description
    Color

    MintCream

    MintCream color.

    public static readonly Color MintCream
    Field Value
    Type Description
    Color

    MistyRose

    MistyRose color.

    public static readonly Color MistyRose
    Field Value
    Type Description
    Color

    Moccasin

    Moccasin color.

    public static readonly Color Moccasin
    Field Value
    Type Description
    Color

    NavajoWhite

    NavajoWhite color.

    public static readonly Color NavajoWhite
    Field Value
    Type Description
    Color

    Navy

    Navy color.

    public static readonly Color Navy
    Field Value
    Type Description
    Color

    OldLace

    OldLace color.

    public static readonly Color OldLace
    Field Value
    Type Description
    Color

    Olive

    Olive color.

    public static readonly Color Olive
    Field Value
    Type Description
    Color

    OliveDrab

    OliveDrab color.

    public static readonly Color OliveDrab
    Field Value
    Type Description
    Color

    Orange

    Orange color.

    public static readonly Color Orange
    Field Value
    Type Description
    Color

    OrangeRed

    OrangeRed color.

    public static readonly Color OrangeRed
    Field Value
    Type Description
    Color

    Orchid

    Orchid color.

    public static readonly Color Orchid
    Field Value
    Type Description
    Color

    PaleGoldenrod

    PaleGoldenrod color.

    public static readonly Color PaleGoldenrod
    Field Value
    Type Description
    Color

    PaleGreen

    PaleGreen color.

    public static readonly Color PaleGreen
    Field Value
    Type Description
    Color

    PaleTurquoise

    PaleTurquoise color.

    public static readonly Color PaleTurquoise
    Field Value
    Type Description
    Color

    PaleVioletRed

    PaleVioletRed color.

    public static readonly Color PaleVioletRed
    Field Value
    Type Description
    Color

    PapayaWhip

    PapayaWhip color.

    public static readonly Color PapayaWhip
    Field Value
    Type Description
    Color

    PeachPuff

    PeachPuff color.

    public static readonly Color PeachPuff
    Field Value
    Type Description
    Color

    Peru

    Peru color.

    public static readonly Color Peru
    Field Value
    Type Description
    Color

    Pink

    Pink color.

    public static readonly Color Pink
    Field Value
    Type Description
    Color

    Plum

    Plum color.

    public static readonly Color Plum
    Field Value
    Type Description
    Color

    PowderBlue

    PowderBlue color.

    public static readonly Color PowderBlue
    Field Value
    Type Description
    Color

    Purple

    Purple color.

    public static readonly Color Purple
    Field Value
    Type Description
    Color

    R

    The red component of the color.

    [DataMember(0)]
    public byte R
    Field Value
    Type Description
    System.Byte

    Red

    Red color.

    public static readonly Color Red
    Field Value
    Type Description
    Color

    RosyBrown

    RosyBrown color.

    public static readonly Color RosyBrown
    Field Value
    Type Description
    Color

    RoyalBlue

    RoyalBlue color.

    public static readonly Color RoyalBlue
    Field Value
    Type Description
    Color

    SaddleBrown

    SaddleBrown color.

    public static readonly Color SaddleBrown
    Field Value
    Type Description
    Color

    Salmon

    Salmon color.

    public static readonly Color Salmon
    Field Value
    Type Description
    Color

    SandyBrown

    SandyBrown color.

    public static readonly Color SandyBrown
    Field Value
    Type Description
    Color

    SeaGreen

    SeaGreen color.

    public static readonly Color SeaGreen
    Field Value
    Type Description
    Color

    SeaShell

    SeaShell color.

    public static readonly Color SeaShell
    Field Value
    Type Description
    Color

    Sienna

    Sienna color.

    public static readonly Color Sienna
    Field Value
    Type Description
    Color

    Silver

    Silver color.

    public static readonly Color Silver
    Field Value
    Type Description
    Color

    SkyBlue

    SkyBlue color.

    public static readonly Color SkyBlue
    Field Value
    Type Description
    Color

    SlateBlue

    SlateBlue color.

    public static readonly Color SlateBlue
    Field Value
    Type Description
    Color

    SlateGray

    SlateGray color.

    public static readonly Color SlateGray
    Field Value
    Type Description
    Color

    Snow

    Snow color.

    public static readonly Color Snow
    Field Value
    Type Description
    Color

    SpringGreen

    SpringGreen color.

    public static readonly Color SpringGreen
    Field Value
    Type Description
    Color

    SteelBlue

    SteelBlue color.

    public static readonly Color SteelBlue
    Field Value
    Type Description
    Color

    Tan

    Tan color.

    public static readonly Color Tan
    Field Value
    Type Description
    Color

    Teal

    Teal color.

    public static readonly Color Teal
    Field Value
    Type Description
    Color

    Thistle

    Thistle color.

    public static readonly Color Thistle
    Field Value
    Type Description
    Color

    Tomato

    Tomato color.

    public static readonly Color Tomato
    Field Value
    Type Description
    Color

    Transparent

    Transparent color.

    public static readonly Color Transparent
    Field Value
    Type Description
    Color

    Turquoise

    Turquoise color.

    public static readonly Color Turquoise
    Field Value
    Type Description
    Color

    VeryDimGray

    VeryDimGray color.

    public static readonly Color VeryDimGray
    Field Value
    Type Description
    Color

    Violet

    Violet color.

    public static readonly Color Violet
    Field Value
    Type Description
    Color

    Wheat

    Wheat color.

    public static readonly Color Wheat
    Field Value
    Type Description
    Color

    White

    White color.

    public static readonly Color White
    Field Value
    Type Description
    Color

    WhiteSmoke

    WhiteSmoke color.

    public static readonly Color WhiteSmoke
    Field Value
    Type Description
    Color

    Yellow

    Yellow color.

    public static readonly Color Yellow
    Field Value
    Type Description
    Color

    YellowGreen

    YellowGreen color.

    public static readonly Color YellowGreen
    Field Value
    Type Description
    Color

    Zero

    Zero color.

    public static readonly Color Zero
    Field Value
    Type Description
    Color
    | Improve this Doc View Source

    Properties


    Item[Int32]

    Gets or sets the component at the specified index.

    public byte this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index

    The index of the component to access. Use 0 for the red(R) component, 1 for the green(G) component, 2 for the blue(B) component, and 3 for the alpha(A) component.

    Property Value
    Type Description
    System.Byte

    The value of the red, green, blue, or alpha component, depending on the index.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    Thrown when the index is out of the range [0, 3].

    | Improve this Doc View Source

    Methods


    Add(Color, Color)

    Adds two colors.

    public static Color Add(Color left, Color right)
    Parameters
    Type Name Description
    Color left

    The first color to add.

    Color right

    The second color to add.

    Returns
    Type Description
    Color

    The sum of the two colors.


    Add(ref Color, ref Color, out Color)

    Adds two colors.

    public static void Add(ref Color left, ref Color right, out Color result)
    Parameters
    Type Name Description
    Color left

    The first color to add.

    Color right

    The second color to add.

    Color result

    When the method completes, completes the sum of the two colors.


    AdjustContrast(Color, Single)

    Adjusts the contrast of a color.

    public static Color AdjustContrast(Color value, float contrast)
    Parameters
    Type Name Description
    Color value

    The color whose contrast is to be adjusted.

    System.Single contrast

    The amount by which to adjust the contrast.

    Returns
    Type Description
    Color

    The adjusted color.


    AdjustContrast(ref Color, Single, out Color)

    Adjusts the contrast of a color.

    public static void AdjustContrast(ref Color value, float contrast, out Color result)
    Parameters
    Type Name Description
    Color value

    The color whose contrast is to be adjusted.

    System.Single contrast

    The amount by which to adjust the contrast.

    Color result

    When the method completes, contains the adjusted color.


    AdjustSaturation(Color, Single)

    Adjusts the saturation of a color.

    public static Color AdjustSaturation(Color value, float saturation)
    Parameters
    Type Name Description
    Color value

    The color whose saturation is to be adjusted.

    System.Single saturation

    The amount by which to adjust the saturation.

    Returns
    Type Description
    Color

    The adjusted color.


    AdjustSaturation(ref Color, Single, out Color)

    Adjusts the saturation of a color.

    public static void AdjustSaturation(ref Color value, float saturation, out Color result)
    Parameters
    Type Name Description
    Color value

    The color whose saturation is to be adjusted.

    System.Single saturation

    The amount by which to adjust the saturation.

    Color result

    When the method completes, contains the adjusted color.


    Clamp(Color, Color, Color)

    Restricts a value to be within a specified range.

    public static Color Clamp(Color value, Color min, Color max)
    Parameters
    Type Name Description
    Color value

    The value to clamp.

    Color min

    The minimum value.

    Color max

    The maximum value.

    Returns
    Type Description
    Color

    The clamped value.


    Clamp(ref Color, ref Color, ref Color, out Color)

    Restricts a value to be within a specified range.

    public static void Clamp(ref Color value, ref Color min, ref Color max, out Color result)
    Parameters
    Type Name Description
    Color value

    The value to clamp.

    Color min

    The minimum value.

    Color max

    The maximum value.

    Color result

    When the method completes, contains the clamped value.


    Equals(Color)

    Determines whether the specified Color is equal to this instance.

    public bool Equals(Color other)
    Parameters
    Type Name Description
    Color other

    The Color to compare with this instance.

    Returns
    Type Description
    System.Boolean

    true if the specified Color is equal to this instance; otherwise, false.


    Equals(Object)

    Determines whether the specified System.Object is equal to this instance.

    public override bool Equals(object value)
    Parameters
    Type Name Description
    System.Object value

    The System.Object to compare with this instance.

    Returns
    Type Description
    System.Boolean

    true if the specified System.Object is equal to this instance; otherwise, false.

    Overrides
    System.ValueType.Equals(System.Object)

    FromAbgr(Int32)

    Converts the color from a packed ABGR integer.

    public static Color FromAbgr(int color)
    Parameters
    Type Name Description
    System.Int32 color

    A packed integer containing all four color components in ABGR order

    Returns
    Type Description
    Color

    A color.


    FromAbgr(UInt32)

    Converts the color from a packed ABGR integer.

    public static Color FromAbgr(uint color)
    Parameters
    Type Name Description
    System.UInt32 color

    A packed integer containing all four color components in ABGR order

    Returns
    Type Description
    Color

    A color.


    FromBgra(Int32)

    Converts the color from a packed BGRA integer.

    public static Color FromBgra(int color)
    Parameters
    Type Name Description
    System.Int32 color

    A packed integer containing all four color components in BGRA order

    Returns
    Type Description
    Color

    A color.


    FromBgra(UInt32)

    Converts the color from a packed BGRA integer.

    public static Color FromBgra(uint color)
    Parameters
    Type Name Description
    System.UInt32 color

    A packed integer containing all four color components in BGRA order

    Returns
    Type Description
    Color

    A color.


    FromRgba(Int32)

    Converts the color from a packed RGBA integer.

    public static Color FromRgba(int color)
    Parameters
    Type Name Description
    System.Int32 color

    A packed integer containing all four color components in RGBA order

    Returns
    Type Description
    Color

    A color.


    FromRgba(UInt32)

    Converts the color from a packed RGBA integer.

    public static Color FromRgba(uint color)
    Parameters
    Type Name Description
    System.UInt32 color

    A packed integer containing all four color components in RGBA order

    Returns
    Type Description
    Color

    A color.


    GetBrightness()

    Gets the brightness.

    public float GetBrightness()
    Returns
    Type Description
    System.Single

    The Hue-Saturation-Brightness (HSB) saturation for this Color


    GetHashCode()

    Returns a hash code for this instance.

    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

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

    Overrides
    System.ValueType.GetHashCode()

    GetHue()

    Gets the hue.

    public float GetHue()
    Returns
    Type Description
    System.Single

    The Hue-Saturation-Brightness (HSB) saturation for this Color


    GetSaturation()

    Gets the saturation.

    public float GetSaturation()
    Returns
    Type Description
    System.Single

    The Hue-Saturation-Brightness (HSB) saturation for this Color


    Lerp(Color, Color, Single)

    Performs a linear interpolation between two colors.

    public static Color Lerp(Color start, Color end, float amount)
    Parameters
    Type Name Description
    Color start

    Start color.

    Color end

    End color.

    System.Single amount

    Value between 0 and 1 indicating the weight of end.

    Returns
    Type Description
    Color

    The linear interpolation of the two colors.

    Remarks

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


    Lerp(ref Color, ref Color, Single, out Color)

    Performs a linear interpolation between two colors.

    public static void Lerp(ref Color start, ref Color end, float amount, out Color result)
    Parameters
    Type Name Description
    Color start

    Start color.

    Color end

    End color.

    System.Single amount

    Value between 0 and 1 indicating the weight of end.

    Color result

    When the method completes, contains the linear interpolation of the two colors.

    Remarks

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


    Max(Color, Color)

    Returns a color containing the largest components of the specified colorss.

    public static Color Max(Color left, Color right)
    Parameters
    Type Name Description
    Color left

    The first source color.

    Color right

    The second source color.

    Returns
    Type Description
    Color

    A color containing the largest components of the source colors.


    Max(ref Color, ref Color, out Color)

    Returns a color containing the smallest components of the specified colors.

    public static void Max(ref Color left, ref Color right, out Color result)
    Parameters
    Type Name Description
    Color left

    The first source color.

    Color right

    The second source color.

    Color result

    When the method completes, contains an new color composed of the largest components of the source colors.


    Min(Color, Color)

    Returns a color containing the smallest components of the specified colors.

    public static Color Min(Color left, Color right)
    Parameters
    Type Name Description
    Color left

    The first source color.

    Color right

    The second source color.

    Returns
    Type Description
    Color

    A color containing the smallest components of the source colors.


    Min(ref Color, ref Color, out Color)

    Returns a color containing the smallest components of the specified colors.

    public static void Min(ref Color left, ref Color right, out Color result)
    Parameters
    Type Name Description
    Color left

    The first source color.

    Color right

    The second source color.

    Color result

    When the method completes, contains an new color composed of the smallest components of the source colors.


    Modulate(Color, Color)

    Modulates two colors.

    public static Color Modulate(Color left, Color right)
    Parameters
    Type Name Description
    Color left

    The first color to modulate.

    Color right

    The second color to modulate.

    Returns
    Type Description
    Color

    The modulated color.


    Modulate(ref Color, ref Color, out Color)

    Modulates two colors.

    public static void Modulate(ref Color left, ref Color right, out Color result)
    Parameters
    Type Name Description
    Color left

    The first color to modulate.

    Color right

    The second color to modulate.

    Color result

    When the method completes, contains the modulated color.


    Negate(Color)

    Negates a color.

    public static Color Negate(Color value)
    Parameters
    Type Name Description
    Color value

    The color to negate.

    Returns
    Type Description
    Color

    The negated color.


    Negate(ref Color, out Color)

    Negates a color.

    public static void Negate(ref Color value, out Color result)
    Parameters
    Type Name Description
    Color value

    The color to negate.

    Color result

    When the method completes, contains the negated color.


    Scale(Color, Single)

    Scales a color.

    public static Color Scale(Color value, float scale)
    Parameters
    Type Name Description
    Color value

    The color to scale.

    System.Single scale

    The amount by which to scale.

    Returns
    Type Description
    Color

    The scaled color.


    Scale(ref Color, Single, out Color)

    Scales a color.

    public static void Scale(ref Color value, float scale, out Color result)
    Parameters
    Type Name Description
    Color value

    The color to scale.

    System.Single scale

    The amount by which to scale.

    Color result

    When the method completes, contains the scaled color.


    SmoothStep(Color, Color, Single)

    Performs a cubic interpolation between two colors.

    public static Color SmoothStep(Color start, Color end, float amount)
    Parameters
    Type Name Description
    Color start

    Start color.

    Color end

    End color.

    System.Single amount

    Value between 0 and 1 indicating the weight of end.

    Returns
    Type Description
    Color

    The cubic interpolation of the two colors.


    SmoothStep(ref Color, ref Color, Single, out Color)

    Performs a cubic interpolation between two colors.

    public static void SmoothStep(ref Color start, ref Color end, float amount, out Color result)
    Parameters
    Type Name Description
    Color start

    Start color.

    Color end

    End color.

    System.Single amount

    Value between 0 and 1 indicating the weight of end.

    Color result

    When the method completes, contains the cubic interpolation of the two colors.


    Subtract(Color, Color)

    Subtracts two colors.

    public static Color Subtract(Color left, Color right)
    Parameters
    Type Name Description
    Color left

    The first color to subtract.

    Color right

    The second color to subtract

    Returns
    Type Description
    Color

    The difference of the two colors.


    Subtract(ref Color, ref Color, out Color)

    Subtracts two colors.

    public static void Subtract(ref Color left, ref Color right, out Color result)
    Parameters
    Type Name Description
    Color left

    The first color to subtract.

    Color right

    The second color to subtract.

    Color result

    WHen the method completes, contains the difference of the two colors.


    ToAbgr()

    Converts the color into a packed integer.

    public int ToAbgr()
    Returns
    Type Description
    System.Int32

    A packed integer containing all four color components.


    ToArgb()

    Converts the color into a packed integer.

    public int ToArgb()
    Returns
    Type Description
    System.Int32

    A packed integer containing all four color components.


    ToArray()

    Creates an array containing the elements of the color.

    public byte[] ToArray()
    Returns
    Type Description
    System.Byte[]

    A four-element array containing the components of the color in RGBA order.


    ToBgra()

    Converts the color into a packed integer.

    public int ToBgra()
    Returns
    Type Description
    System.Int32

    A packed integer containing all four color components.


    ToColor3()

    Converts the color into a three component color.

    public Color3 ToColor3()
    Returns
    Type Description
    Color3

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


    ToColor4()

    Convert this instance to a Color4

    public Color4 ToColor4()
    Returns
    Type Description
    Color4

    The result of the conversion.


    ToRgba()

    Converts the color into a packed integer.

    public int ToRgba()
    Returns
    Type Description
    System.Int32

    A packed integer containing all four color components.


    ToString()

    Returns a System.String that represents this instance.

    public override string ToString()
    Returns
    Type Description
    System.String

    A System.String that represents this instance.

    Overrides
    System.ValueType.ToString()

    ToVector3()

    Converts the color into a three component vector.

    public Vector3 ToVector3()
    Returns
    Type Description
    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
    Type Description
    Vector4

    A four component vector containing all four color components.

    | Improve this Doc View Source

    Operators


    Addition(Color, Color)

    Adds two colors.

    public static Color operator +(Color left, Color right)
    Parameters
    Type Name Description
    Color left

    The first color to add.

    Color right

    The second color to add.

    Returns
    Type Description
    Color

    The sum of the two colors.


    Equality(Color, Color)

    Tests for equality between two objects.

    public static bool operator ==(Color left, Color right)
    Parameters
    Type Name Description
    Color left

    The first value to compare.

    Color right

    The second value to compare.

    Returns
    Type Description
    System.Boolean

    true if left has the same value as right; otherwise, false.


    Explicit(Color to Color3)

    Performs an explicit conversion from Color to Color3.

    public static explicit operator Color3(Color value)
    Parameters
    Type Name Description
    Color value

    The value.

    Returns
    Type Description
    Color3

    The result of the conversion.


    Explicit(Color to Vector3)

    Performs an explicit conversion from Color to Vector3.

    public static explicit operator Vector3(Color value)
    Parameters
    Type Name Description
    Color value

    The value.

    Returns
    Type Description
    Vector3

    The result of the conversion.


    Explicit(Color to Vector4)

    Performs an explicit conversion from Color to Vector4.

    public static explicit operator Vector4(Color value)
    Parameters
    Type Name Description
    Color value

    The value.

    Returns
    Type Description
    Vector4

    The result of the conversion.


    Explicit(Color to Int32)

    Performs an explicit conversion from System.Int32 to Color.

    public static explicit operator int (Color value)
    Parameters
    Type Name Description
    Color value

    The value.

    Returns
    Type Description
    System.Int32

    The result of the conversion.


    Explicit(Color3 to Color)

    Performs an explicit conversion from Color3 to Color.

    public static explicit operator Color(Color3 value)
    Parameters
    Type Name Description
    Color3 value

    The value.

    Returns
    Type Description
    Color

    The result of the conversion.


    Explicit(Color4 to Color)

    Performs an explicit conversion from Color4 to Color.

    public static explicit operator Color(Color4 value)
    Parameters
    Type Name Description
    Color4 value

    The value.

    Returns
    Type Description
    Color

    The result of the conversion.


    Explicit(Vector3 to Color)

    Performs an explicit conversion from Vector3 to Color.

    public static explicit operator Color(Vector3 value)
    Parameters
    Type Name Description
    Vector3 value

    The value.

    Returns
    Type Description
    Color

    The result of the conversion.


    Explicit(Vector4 to Color)

    Performs an explicit conversion from Vector4 to Color.

    public static explicit operator Color(Vector4 value)
    Parameters
    Type Name Description
    Vector4 value

    The value.

    Returns
    Type Description
    Color

    The result of the conversion.


    Explicit(Int32 to Color)

    Performs an explicit conversion from System.Int32 to Color.

    public static explicit operator Color(int value)
    Parameters
    Type Name Description
    System.Int32 value

    The value.

    Returns
    Type Description
    Color

    The result of the conversion.


    Implicit(Color to Color4)

    Performs an implicit conversion from Color to Color4.

    public static implicit operator Color4(Color value)
    Parameters
    Type Name Description
    Color value

    The value.

    Returns
    Type Description
    Color4

    The result of the conversion.


    Inequality(Color, Color)

    Tests for inequality between two objects.

    public static bool operator !=(Color left, Color right)
    Parameters
    Type Name Description
    Color left

    The first value to compare.

    Color right

    The second value to compare.

    Returns
    Type Description
    System.Boolean

    true if left has a different value than right; otherwise, false.


    Multiply(Color, Color)

    Modulates two colors.

    public static Color operator *(Color left, Color right)
    Parameters
    Type Name Description
    Color left

    The first color to modulate.

    Color right

    The second color to modulate.

    Returns
    Type Description
    Color

    The modulated color.


    Multiply(Color, Single)

    Scales a color.

    public static Color operator *(Color value, float scale)
    Parameters
    Type Name Description
    Color value

    The factor by which to scale the color.

    System.Single scale

    The color to scale.

    Returns
    Type Description
    Color

    The scaled color.


    Multiply(Single, Color)

    Scales a color.

    public static Color operator *(float scale, Color value)
    Parameters
    Type Name Description
    System.Single scale

    The factor by which to scale the color.

    Color value

    The color to scale.

    Returns
    Type Description
    Color

    The scaled color.


    Subtraction(Color, Color)

    Subtracts two colors.

    public static Color operator -(Color left, Color right)
    Parameters
    Type Name Description
    Color left

    The first color to subtract.

    Color right

    The second color to subtract.

    Returns
    Type Description
    Color

    The difference of the two colors.


    UnaryNegation(Color)

    Negates a color.

    public static Color operator -(Color value)
    Parameters
    Type Name Description
    Color value

    The color to negate.

    Returns
    Type Description
    Color

    A negated color.


    UnaryPlus(Color)

    Assert a color (return it unchanged).

    public static Color operator +(Color value)
    Parameters
    Type Name Description
    Color value

    The color to assert (unchanged).

    Returns
    Type Description
    Color

    The asserted (unchanged) color.


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    ColorExtensions.WithAlpha(Color, Byte)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation