Create a new MTextColor instance.
Optionalcolor: number | [number, number, number]The initial color: number for ACI, [r,g,b] for RGB, or null/undefined for default (ACI=256).
Get the current ACI color value.
The ACI color (0-256), or null if using RGB.
Get the current RGB color as a tuple [r, g, b], or null if not set.
The RGB color tuple, or null if using ACI.
Set the RGB color. Setting this disables ACI color.
The RGB color tuple [r, g, b], or null to use ACI.
Returns true if the color is set by RGB, false if by ACI.
Returns true if the color is set by ACI, false if by RGB.
Get or set the internal RGB value as a number (0xRRGGBB), or null if not set. Setting this will switch to RGB mode and set ACI to null.
Returns a deep copy of this color.
A new MTextColor instance with the same color state.
Returns a plain object for serialization.
An object with aci, rgb (tuple), and rgbValue (number or null).
Equality check for color.
The other MTextColor to compare.
True if both ACI and RGB values are equal.
Class to handle ACI and RGB color logic for MText.
This class encapsulates color state for MText, supporting both AutoCAD Color Index (ACI) and RGB color. Only one color mode is active at a time: setting an RGB color disables ACI, and vice versa. RGB is stored as a single 24-bit integer (0xRRGGBB) for efficient comparison and serialization.
Example usage: