Show / Hide Table of Contents

    Struct Color

    Represents a color.

    Implements
    System.IEquatable<Color>
    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: AGS.API
    Assembly: AGS.API.dll
    Syntax
    [DataContract]
    public struct Color : IEquatable<Color>

    Properties

    | Improve this Doc View Source

    A

    Gets the alpha element of the color. 0 is fully transparent and 255 is fully opaque.

    Declaration
    public byte A { get; }
    Property Value
    Type Description
    System.Byte

    The alpha element of the color.

    | Improve this Doc View Source

    B

    Gets the blue element of the color. 0 is no red and 255 is fully blue.

    Declaration
    public byte B { get; }
    Property Value
    Type Description
    System.Byte

    The blue element of the color.

    | Improve this Doc View Source

    G

    Gets the green element of the color. 0 is no red and 255 is fully green.

    Declaration
    public byte G { get; }
    Property Value
    Type Description
    System.Byte

    The green element of the color.

    | Improve this Doc View Source

    R

    Gets the red element of the color. 0 is no red and 255 is fully red.

    Declaration
    public byte R { get; }
    Property Value
    Type Description
    System.Byte

    The red element of the color.

    | Improve this Doc View Source

    Value

    A single value which encodes the color within it, 8 bits per color element, where the order is A (alpha)-R (red)-G (green)-B (blue).

    Declaration
    [DataMember(Name = "Argb")]
    public uint Value { get; }
    Property Value
    Type Description
    System.UInt32

    The color value.

    Methods

    | Improve this Doc View Source

    Equals(Color)

    Declaration
    public bool Equals(Color other)
    Parameters
    Type Name Description
    Color other
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)
    | Improve this Doc View Source

    FromArgb(Byte, Byte, Byte, Byte)

    Gets a color from ARGB elements (alpha, red, green, blue).

    Declaration
    public static Color FromArgb(byte a, byte r, byte g, byte b)
    Parameters
    Type Name Description
    System.Byte a

    The alpha component.

    System.Byte r

    The red component.

    System.Byte g

    The green component.

    System.Byte b

    The blue component.

    Returns
    Type Description
    Color

    The color.

    | Improve this Doc View Source

    FromHexa(UInt32)

    Gets a color from a hexa value (in ARGB format).

    Declaration
    public static Color FromHexa(uint argb)
    Parameters
    Type Name Description
    System.UInt32 argb

    ARGB.

    Returns
    Type Description
    Color

    The hexa.

    | Improve this Doc View Source

    FromHsla(Int32, Single, Single, Byte)

    Gets a color from HSLA format (https://en.wikipedia.org/wiki/HSL_and_HSV). Also see: https://css-tricks.com/yay-for-hsla/, and a helpful calculator: https://www.w3schools.com/colors/colors_hsl.asp

    Declaration
    public static Color FromHsla(int hue, float saturation, float lightness, byte a)
    Parameters
    Type Name Description
    System.Int32 hue

    Hue: Think of a color wheel. Around 0o and 360o are reds 120o are greens, 240o are blues. Use anything in between 0-360. Values above and below will be modulus 360.

    System.Single saturation

    Saturation: 0 is completely denatured (grayscale). 1 is fully saturated (full color).

    System.Single lightness

    Lightness: 0 is completely dark (black). 1 is completely light (white).

    System.Byte a

    The alpha component: 0 is fully transparent. 255 is fully opaque.

    Returns
    Type Description
    Color

    The color.

    | Improve this Doc View Source

    FromRgba(Byte, Byte, Byte, Byte)

    Gets a color from RGBA elements (red, green, blue, alpha).

    Declaration
    public static Color FromRgba(byte r, byte g, byte b, byte a)
    Parameters
    Type Name Description
    System.Byte r

    The red component.

    System.Byte g

    The green component.

    System.Byte b

    The blue component.

    System.Byte a

    The alpha component.

    Returns
    Type Description
    Color

    The color.

    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()
    | Improve this Doc View Source

    GetHue()

    Gets the hue of the color (based on HSL format: https://en.wikipedia.org/wiki/HSL_and_HSV).

    Declaration
    public int GetHue()
    Returns
    Type Description
    System.Int32

    The hue.

    | Improve this Doc View Source

    GetLightness()

    Gets the lightness of the color (based on HSL format: https://en.wikipedia.org/wiki/HSL_and_HSV).

    Declaration
    public float GetLightness()
    Returns
    Type Description
    System.Single

    The saturation.

    | Improve this Doc View Source

    GetSaturation()

    Gets the saturation of the color (based on HSL format: https://en.wikipedia.org/wiki/HSL_and_HSV).

    Declaration
    public float GetSaturation()
    Returns
    Type Description
    System.Single

    The saturation.

    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.ValueType.ToString()
    | Improve this Doc View Source

    WithAlpha(Byte)

    Gets a new color with a changed alpha (transparency).

    Declaration
    public Color WithAlpha(byte a)
    Parameters
    Type Name Description
    System.Byte a

    The alpha component. 0 is fully transparent and 255 is fully opaque.

    Returns
    Type Description
    Color

    The color.

    Implements

    System.IEquatable<T>
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX