def color.hex

gralha-svg-render@0.1.0.1 · svg.bend:615

import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U
import gralha-image@0.1.0.1/image.bend as Img

615def color.hex(+x: U32, +len: U32) -> Img.Color:
616  U.branch(Img.Color, U32.is_eq(len, 3) || U32.is_eq(len, 4),
617    _ => color.hex.short(x, len),
618    _ => U.choose(Img.Color, U32.is_eq(len, 8), Img.rgba(byte(x, 16777216), byte(x, 65536), byte(x, 256), byte(x, 1)), color.rgb(x)))

Uses (10)

Used by (2)