def color.hex.short

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

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

611def color.hex.short(+x: U32, len: U32) -> Img.Color:
612  U.choose(Img.Color, U32.is_eq(len, 4), Img.rgba(nibble(x, 4096), nibble(x, 256), nibble(x, 16), nibble(x, 1)),
613    Img.rgba(nibble(x, 256), nibble(x, 16), nibble(x, 1), 1.0))

Uses (6)

Used by (1)