ConvertColorToString

Converts a color value to its string representation.

Syntax

ConvertColorToString(color_value: number | string, color_name = false): string

Parameters

  • color_value: number | string - The color value to convert

  • color_name: boolean - Whether to return the color name instead of RGB values

Return Value

Returns a string representing the color either as:

  • RGB components (e.g., "255,0,0")

  • Color name (e.g., "clrRed") if color_name is true and a matching name exists

Description

The ConvertColorToString method converts a color value into a string representation. It can:

  1. Convert numeric color values to RGB component strings

  2. Convert hex color strings to RGB component strings

  3. Find and return matching color names when requested

The method supports both numeric color values and hex string inputs, making it versatile for different color formats.

Example

Last updated