|
@@ -37,7 +37,10 @@ fn color_rgb_float(color: Color) -> String =
|
|
|
@description("Convert a color to its hexadecimal representation.")
|
|
|
@example("rgb(225, 36, 143) -> color_hex")
|
|
|
fn color_hex(color: Color) -> String =
|
|
|
- str_prepend("#", str_replace(" ", "0", str_replace("0x", "", "{color -> _color_to_scalar -> hex:>8}")))
|
|
|
+ "{color -> _color_to_scalar -> hex:>8}" |>
|
|
|
+ str_replace("0x", "") |>
|
|
|
+ str_replace(" ", "0") |>
|
|
|
+ str_prepend("#")
|
|
|
|
|
|
let black: Color = rgb(0, 0, 0)
|
|
|
let white: Color = rgb(255, 255, 255)
|