ConvertColorToARGB

Converts a color value to ARGB (Alpha, Red, Green, Blue) format.

Syntax

ConvertColorToARGB(color: number | string, alpha = 255): number

Parameters

  • color: number | string - The color value to convert. Can be a number or hex string

  • alpha: number - The alpha (opacity) value (0-255)

Return Value

Returns a number representing the color in ARGB format.

Description

The ConvertColorToARGB method converts a color value to its ARGB representation. It can handle both numeric and string inputs:

  • For numeric inputs: Extracts RGB components and combines with alpha

  • For string inputs: Supports both RGB (#RRGGBB) and ARGB (#AARRGGBB) hex formats

Example

Last updated