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
System.Object
Color
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.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(Int32, Int32, Int32, Int32)
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 |
---|---|---|
System.Int32 | red | |
System.Int32 | green | |
System.Int32 | blue | |
System.Int32 | 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 |
---|---|---|
System.String | poundcolor |
Methods
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
System.Object | other |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
System.Object.Equals(System.Object)
Finalize()
Declaration
protected void Finalize()
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
System.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 |
---|---|
System.String |
Overrides
System.Object.ToString()
Operators
Equality(Color, Color)
Declaration
public static bool operator ==(Color a, Color b)
Parameters
Type | Name | Description |
---|---|---|
Color | a | |
Color | b |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(Color, Color)
Declaration
public static bool operator !=(Color a, Color b)
Parameters
Type | Name | Description |
---|---|---|
Color | a | |
Color | b |
Returns
Type | Description |
---|---|
System.Boolean |