ctransform VEX function

Transforms between color spaces.

Contexts: image3d, chop, cop, pop, sop, surface, displace, fog, light, shadow, photon, cvex

  1. vector ctransform(string fromspace, tospace; vector clr)

  2. vector ctransform(string tospace; vector clr)

    If you don’t give a fromspace, assumes "cspace:rgb".

Transforms color tuple clr from one color space to another.

The possible arguments for fromspace and tospace are "cspace:rgb", "cspace:hsl", "cspace:hsv", "cspace:XYZ", and "cspace:Lab".