Media

vcolor

Converts colors between RGB, HLS and YIQ.

Released v1.0.0 · 2026-09-28
Import
use "stdlib/color.ven"

Every function takes and returns three numbers between zero and one in a plain list, the same shape the RGB to HSV builtins use. Values outside that range pass through unchecked.

vcolor.ven
print rgb_to_hls(0.5, 0.25, 0.75)
:: prints: [0.75, 0.5, 0.5]
Reference (6 functions)

API reference

rgb_to_hls(r, g, b)

rgb_to_hls(0.5, 0.25, 0.75)
:: [0.75, 0.5, 0.5]

hls_to_rgb(h, l, s)

hls_to_rgb(0.75, 0.5, 0.5)
:: [0.4999999999999998, 0.25, 0.75]

rgb_to_yiq(r, g, b)

rgb_to_yiq(0.5, 0.25, 0.75)
:: [0.38, -0.011100000000000013, 0.20929999999999999]

yiq_to_rgb(y, i, q)

yiq_to_rgb(0.4, 0.1, -0.05)
:: [0.4635103926096998, 0.4043057893294712, 0.20369515011547346]

Get notified when vcolor changes

Get notified about

New versions and security advisories.

New and updated packages, once a day.

News on the math model built in Venutian.