ParseColor

Parses a color string into a color value.

Syntax

ParseColor(color_string: string): string

Parameters

  • color_string: string - The color string to parse

Return Value

Returns a string representing the color in hex format (#RRGGBB).

Description

The ParseColor method converts various color string formats into a standardized hex color representation. It supports:

  1. Named Colors (e.g., 'clrRed', 'clrBlue')

  2. RGB Components (e.g., '255,0,0')

The method recognizes a wide range of predefined color names, including:

  • Basic colors (clrRed, clrGreen, clrBlue, etc.)

  • Extended colors (clrDarkGreen, clrLightBlue, etc.)

  • Web colors (clrAliceBlue, clrCornsilk, etc.)

Example

Last updated