Color Transforms

A color transform is a modification to related properties of an underlying color. For example, transparency is a property that is related to color. Color transforms are specified as child tags off any color model's tag.

The following are the allowed color transforms and descriptions of the transformations they apply:

  • tint: Yields a lighter version of its input color. A 10% tint is 10% of the input color combined with 90% white.

  • shade: Yields a darker version of its input color. A 10% shade is 10% of the input color combined with 90% black.

  • comp: Yields the complement of its input color. For example, the complement of red is green.

  • inv: Yields the inverse of its input color. For example, the inverse of red (1,0,0) is cyan (0,1,1).

  • gray: Yields a grayscale of its input color, taking into relative intensities of the red, green, and blue primaries.

  • alpha: Yields its input color with the specified opacity, but with its color unchanged.

  • alphaOff: Yields a more or less opaque version of its input color. An alpha offset never increases the alpha beyond 100% or decreases below 0%; i.e., the result of the transform pins the alpha to the range of [0%,100%]. A 10% alpha offset increases a 50% opacity to 60%. A -10% alpha offset decreases a 50% opacity to 40%.

  • alphaMod: Yields a more or less opaque version of its input color. An alpha modulate never increases the alpha beyond 100%. A 200% alpha modulate makes a input color twice as opaque as before. A 50% alpha modulate makes a input color half as opaque as before.

  • hue: Yields the input color with the specified hue, but with its saturation and luminance unchanged.

  • hueOff: Yields the input color with its hue shifted, but with its saturation and luminance unchanged.

  • hueMod: Yields the input color with its hue modulated by the given percentage.

  • sat: Yields the input color with the specified saturation, but with its hue and luminance unchanged. Typically saturation values fall in the range [0%, 100%].

  • satOff: Yields the input color with its saturation shifted, but with its hue and luminance unchanged.

  • satMod: Yields the input color with its saturation modulated by the given percentage. A 50% saturation modulate will reduce the saturation by half. A 200% saturation modulate will double the saturation.

  • lum: Yields the input color with the specified luminance, but with its hue and saturation unchanged. Typically, luminance values fall in the range [0%,100%].

  • lumOff: Yields the input color with its luminance shifted, but with its hue and saturation unchanged.

  • lumMod: Yields the input color with its luminance modulated by the given percentage. A 50% luminance modulate will reduce the luminance by half. A 200% luminance modulate will double the luminance.

  • red: Yields the input color with the specified red component, but with its green and blue components unchanged.

  • redOff: Yields the input color with its red component shifted, but with its green and blue components unchanged.

  • redMod: Yields the input color with its red component modulated by the given percentage. A 50% red modulate will reduce the red component by half. A 200% red modulate will double the red component.

  • green: Yields the input color with the specified green component, but with its red and blue components unchanged.

  • greenOff: Yields the input color with its green component shifted, but with its red and blue components unchanged.

  • greenMod: Yields the input color with its green component modulated by the given percentage. A 50% green modulate will reduce the green component by half. A 200% green modulate will double the green component.

  • blue: Yields the input color with the specified blue component, but with its red and green components unchanged.

  • blueOff: Yields the input color with its blue component shifted, but with its red and green components unchanged.

  • blueMod: Yields the input color with its blue component modulated by the given percentage. A 50% blue modulate will reduce the blue component by half. A 200% blue modulate will double the blue component.

  • gamma: Yields the sRGB gamma shift of its input color.

  • invGamma: Yields the inverse sRGB gamma shift of its input color.