TeklaDrawingColor Structure |
The TeklaDrawingColor struct contains a compact storage for drawing color data
This struct is intended to be an "all-in-one" solution for OpenAPI users interacting with drawing colors.
It supports old enums and new user defined RGB colors. The essential principle of this struct is that once
an object of this struct is created (i.e. you have one of these objects instantiated), it contains valid
RGB information, as well as a valid enum value in the case of a standard color. This means users will never
have to run checks to see if their object has a valid RGB value. After all, if they receive this "TrueColor"
object, they expect we can provide them RGB information.
To support this functionality, we need to make sure that there is RGB information present for every single
object of this type that is created. All objects constructed with RGB values are guaranteed to have this,
as well as the ordinary standard drawing colors with values between 0 and 255. Other indices are forbidden,
and will cause an error upon construction attempt. Given that the constructor of this struct can throw an exception,
the struct should never be used as a "middleman", meaning it should never be used to pass color information
from one place to another within the codebase: int color -> TeklaDrawingColor -> int color.
Namespace: Tekla.Structures.Drawing
Assembly: Tekla.Structures.Drawing (in Tekla.Structures.Drawing.dll) Version: 2024.0.0+a110b435391768740483e3032720a566518c9a63
Syntax
The TeklaDrawingColor type exposes the following members.
Constructors
Name | Description | |
---|---|---|
TeklaDrawingColor(Color) |
Construct a TeklaDrawingColor instance by passing in an RGB System.Drawing.Color value.
This is the safe non-throwing constructor to use.
| |
TeklaDrawingColor(DrawingColors) |
Construct a TeklaDrawingColor instance by passing in a Tekla standard color enum value.
Use of this constructor is discouraged, please use TeklaDrawingColor(Color RGB)
| |
TeklaDrawingColor(DrawingHatchColors) |
Construct a TeklaDrawingColor instance by passing in a Tekla standard color hatch enum value. Use only for hatches.
|
Properties
Name | Description | |
---|---|---|
DrawingColorEnum |
Enum for the drawing color
| |
RGBColor |
Red, Green, Blue representation of the color.
|
See Also