Color

Type aliasin image-optimizer@fastly/js-compute 3.46.0View source
type Color = string | { r: number; g: number; b: number; a?: number }

Alias for string | { r: number; g: number; b: number; a?: number }.

A color, either a 3 or 6 character hexadecimal string, or an object with RGB(A) components.

When specified as an object:

  • r, g, b are integers (0-255)
  • a is an optional alpha value (0.0-1.0)