Color.RGB.ToHex¶
RGB to Hex conversion
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| red | INT64 | The red value (0-255) | ||
| green | INT64 | The green value (0-255) | ||
| blue | INT64 | The blue value (0-255) | ||
| alpha | DECIMAL | BLANK() |
Optional: The alpha value (0-1) |
STRING hex color code
function 'DaxLib.SVG.Color.RGB.ToHex' =
(
red: INT64,
green: INT64,
blue: INT64,
alpha: DOUBLE = BLANK()
) =>
"#" &
DaxLib.SVG.Color.Int.ToHex( red, 2 ) &
DaxLib.SVG.Color.Int.ToHex( green, 2 ) &
DaxLib.SVG.Color.Int.ToHex( blue, 2 ) &
IF( NOT ISBLANK( alpha ), DaxLib.SVG.Color.Int.ToHex( alpha * 255, 2 ) )