Overview
Sources
Libraries
Images API

Contain Color contain-color

Specify the color used to fill letterboxed areas when mode=contain and contain=color are used.

Values

If not set contain color will use a fully transparent color by default so it will be affected by the value of background-color parameter.

For more information on how to specify colors visit the color values section.

Examples

In the following example we are not specifying a contain-color value so the default white background-color will apply:

GET
https://assets.imglab-cdn.net/woman-03.jpeg?width=1200&height=600&mode=contain
Woman posing image with a default white letterboxed background area using contain mode.
x px

For output formats with transparency support it's possible to set a color with alpha transparency.

In this example we are using a half-transparent color using contain-color=43,73,62,128:

GET
https://assets.imglab-cdn.net/woman-03.jpeg?width=1200&height=600&mode=contain&contain-color=43%2C73%2C62%2C128&format=png
Woman posing image with a green semi-transparent letterboxed background area using contain mode and contain-color parameter.
x px