bgColor method

void bgColor(
  1. String bgColor
)

The bg-color function lets you set a backgroud color for the given image. This is useful when applying padding or for replacing the transparent pixels of an image. There are three possible types of values for this bgColor is string . It can accept hexadecimal, combination of (Red, Blue, Green) and (Red, Blue, Green, Alpha).

For more details, Read documentation: https://www.contentstack.com/docs/developers/apis/image-delivery-api/#background-color

Example:

final stack = contentstack.Stack(apiKey, deliveryToken, environment);
final imageTransformation = stack.imageTransform(imageUrl);
final response = await imageTransformation.bgColor('cccccc').fetch();

Implementation

void bgColor(String bgColor) {
  query.append('bg-color', bgColor);
}