ACadSharp.Color

struct · ACadSharp · CLR name: ACadSharp.Color

Represents an ACI color that also supports true color.

Base type: System.ValueType. Inherited members are documented on their declaring type.

Interfaces: System.IEquatable[ACadSharp.Color].

import acadsharp
Type = acadsharp.get_type('ACadSharp.Color')

Declared public members

Signatures retain CLR types and names. Python.NET resolves overloads and converts compatible Python values at call time. Property setters are shown only when public. Operators retain their CLR names; Python.NET also maps supported operators to Python syntax.

.ctor

ACadSharp.Color(System.Byte r, System.Byte g, System.Byte b)

Creates a color out of RGB true color bytes.

  • r: Red
  • g: Green
  • b: Blue

.ctor

ACadSharp.Color(System.Byte[] rgb)

Creates a color out of a RGB true color byte array.

  • rgb: Red Green Blue

.ctor

ACadSharp.Color(System.Int16 index)

Creates a new color out of an indexed color.

  • index: Index color with a value between 0 to 257

ApproxIndex

static System.Byte ApproxIndex(System.Byte r, System.Byte g, System.Byte b)

Approximates color from a true color RGB.

Returns: Approximate RGB color.

  • r: Red
  • g: Green
  • b: Blue

Equals

System.Boolean Equals(ACadSharp.Color other)

Documentation inherited from: base member.

Equals

System.Boolean Equals(System.Object obj)

Documentation inherited from: base member.

FromTrueColor

static ACadSharp.Color FromTrueColor(System.UInt32 color)

Creates a color out of a true color int32.

  • color: True color int 32.

GetApproxIndex

System.Int16 GetApproxIndex()

Approximates color from a true color RGB.

Returns: Approximate RGB color.

GetHashCode

System.Int32 GetHashCode()

Documentation inherited from: base member.

GetIndexRGB

static System.ReadOnlySpan[System.Byte] GetIndexRGB(System.Byte index)

Python adapter: acadsharp.colors.index_rgb returns Python bytes. The upstream method returns a stack-only span that Python.NET cannot invoke directly; the compiled adapter calls that exact operation and copies its result.

Returns the RGB color code which matches the passed indexed color.

Returns: Approximate RGB color from indexed color.

GetRgb

System.ReadOnlySpan[System.Byte] GetRgb()

Python adapter: acadsharp.colors.rgb returns Python bytes. The upstream method returns a stack-only span that Python.NET cannot invoke directly; the compiled adapter calls that exact operation and copies its result.

Returns the RGB color code

GetTrueColorRgb

System.ReadOnlySpan[System.Byte] GetTrueColorRgb()

Python adapter: acadsharp.colors.true_color_rgb returns Python bytes. The upstream method returns a stack-only span that Python.NET cannot invoke directly; the compiled adapter calls that exact operation and copies its result.

Returns the RGB color code using the true color value.

Remarks: If the color is not ACadSharp.Color.IsTrueColor it will return the default values for RGB

ToString

System.String ToString()

Documentation inherited from: base member.

B

System.Byte B { get; }

Blue component of the color

Black

static ACadSharp.Color Black { get; }

Defines a default black color.

Blue

static ACadSharp.Color Blue { get; }

Defines a default blue color.

ByBlock

static ACadSharp.Color ByBlock { get; }

Gets the ByBlock color.

ByEntity

static ACadSharp.Color ByEntity { get; }

This is found in some header variables but is not valid for Entities or Objects

ByLayer

static ACadSharp.Color ByLayer { get; }

Gets the ByLayer color.

Cyan

static ACadSharp.Color Cyan { get; }

Defines a default cyan color.

DarkGray

static ACadSharp.Color DarkGray { get; }

Defines a default dark gray color.

Default

static ACadSharp.Color Default { get; }

Defines a default white/black color.

G

System.Byte G { get; }

Green component of the color

Green

static ACadSharp.Color Green { get; }

Defines a default green color.

Index

System.Int16 Index { get; }

Indexed color. If the color is stored as a true color, returns -1;

IsByBlock

System.Boolean IsByBlock { get; }

Defines if the color is defined by block.

IsByLayer

System.Boolean IsByLayer { get; }

Defines if the color is defined by layer.

IsTrueColor

System.Boolean IsTrueColor { get; }

True if the stored color is a true color. False if the color is an indexed color.

LightGray

static ACadSharp.Color LightGray { get; }

Defines a default light gray color.

Magenta

static ACadSharp.Color Magenta { get; }

Defines a default magenta color.

R

System.Byte R { get; }

Red component of the color

Red

static ACadSharp.Color Red { get; }

Defines a default red color.

TrueColor

System.Int32 TrueColor { get; }

True color. If the color is stored as an indexed color, returns -1;

Yellow

static ACadSharp.Color Yellow { get; }

Defines a default yellow color.