Yelp

(The Help System)

color.blend

Blend two colors together at a specified mix level.

Parameters

bg

A color specified in hexidecimal, rgb(), or rgba().

fg

A color specified in hexidecimal, rgb(), or rgba().

mix

The mix level, between 0.0 and 1.0.

This template calculates a color by selecting a midpoint between bg and fg, where the mix parameter specifies how far to move from bg to fg. For opaque colors, setting mix to 0.0 will result in bg, and setting mix to 1.0 will result in fg.

This template takes the alpha values of bg and fg into account, so that specifying 1.0 for mix will result in a color that is the result of overlaying fg on top of bg. In effect, mix acts as a multiplier on the alpha channels of the colors.

This template calls color.r, color.g, color.b, and color.a to get the components of bg and fg. It accepts six-digit and three-digit hexidecimal color codes, colors specified with rgb(), and colors specified with rgba(). It does not accept HSL or named HTML colors.

If the return color is fully opaque, this template returns the color using the rgb() scheme. Otherwise, it uses the rgba() scheme.

Calls Templates