Show / Hide Table of Contents

    Class Color

    A color compatible with SDS2's colors. This object knows how to translate to and from SDS2 pen numbers. It works on a 0-255 rgba color scale.

    Inheritance
    object
    Color
    Inherited Members
    object.GetType()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    Namespace: DesignData.SDS2.Primitives
    Assembly: DesignData.SDS2.Primitives.dll
    Syntax
    public sealed class Color

    Constructors

    Color(PenColor)

    Create a color from the PenColor

    Declaration
    public Color(PenColor pen)
    Parameters
    Type Name Description
    PenColor pen

    Color(int, int, int, int)

    Create a color from rgba values, from 0-255

    Declaration
    public Color(int red, int green, int blue, int alpha = 255)
    Parameters
    Type Name Description
    int red
    int green
    int blue
    int alpha

    Color(string)

    Create a color from a hash or pound string, like in html: "#E6E6FA"

    Declaration
    public Color(string poundcolor)
    Parameters
    Type Name Description
    string poundcolor

    Methods

    Equals(object)

    A color compatible with SDS2's colors. This object knows how to translate to and from SDS2 pen numbers. It works on a 0-255 rgba color scale.

    Declaration
    public override bool Equals(object other)
    Parameters
    Type Name Description
    object other
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)

    ~Color()

    A color compatible with SDS2's colors. This object knows how to translate to and from SDS2 pen numbers. It works on a 0-255 rgba color scale.

    Declaration
    protected ~Color()

    GetHashCode()

    A color compatible with SDS2's colors. This object knows how to translate to and from SDS2 pen numbers. It works on a 0-255 rgba color scale.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()

    GetNearestPen()

    Get the closest pen for this color. This is primarily used internally in SDS2 for pen plotter support.

    Declaration
    public PenColor GetNearestPen()
    Returns
    Type Description
    PenColor

    ToString()

    Get the pound or hash string value of this color

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    Operators

    operator ==(Color, Color)

    A color compatible with SDS2's colors. This object knows how to translate to and from SDS2 pen numbers. It works on a 0-255 rgba color scale.

    Declaration
    public static bool operator ==(Color a, Color b)
    Parameters
    Type Name Description
    Color a
    Color b
    Returns
    Type Description
    bool

    operator !=(Color, Color)

    A color compatible with SDS2's colors. This object knows how to translate to and from SDS2 pen numbers. It works on a 0-255 rgba color scale.

    Declaration
    public static bool operator !=(Color a, Color b)
    Parameters
    Type Name Description
    Color a
    Color b
    Returns
    Type Description
    bool
    Back to top