Skip to main content

Color Formats

Reference. The API supports multiple color formats for various endpoints (e.g. QR codes, components). Colors can be specified as simple RGBA values, linear gradients, or radial gradients.

Simple Color

A simple color is specified as comma-separated RGBA values.

Format

R,G,B
R,G,B,A

Parameters

ParameterTypeRangeRequiredDescription
Rinteger0-255YesRed component
Ginteger0-255YesGreen component
Binteger0-255YesBlue component
Afloat0-1NoAlpha (opacity) component

Examples

"255,0,0"
"255,0,0,1"
"128,128,128,0.5"

Linear Gradient

A linear gradient creates a smooth transition between colors along a straight line.

Format

linear:x1;y1;x2;y2/color1;offset1/color2;offset2/...

Parameters

ParameterTypeRangeRequiredDescription
x1, y1float0-100YesStart point coordinates (percentage)
x2, y2float0-100YesEnd point coordinates (percentage)
colorstring-YesColor value in R,G,B or R,G,B,A format
offsetfloat0-100YesStop position along the gradient line (percentage)

Note: Maximum 5 stop points are allowed.

Examples

"linear:0;0;100;100/255,0,0;0/0,0,255;100"
"linear:0;50;100;50/255,255,255;0/128,128,128;50/0,0,0;100"

Radial Gradient

A radial gradient creates a smooth transition between colors radiating from a center point.

Format

radial:cx;cy;r;fx;fy/color1;offset1/color2;offset2/...
radial:cx;cy;r;fx;fy;fr/color1;offset1/color2;offset2/...

Parameters

ParameterTypeRangeRequiredDescription
cx, cyfloat0-100YesCenter point coordinates (percentage)
rfloat0-100YesRadius (percentage)
fx, fyfloat0-100YesFocal point coordinates (percentage)
frfloat0-100NoFocal radius (percentage)
colorstring-YesColor value in R,G,B or R,G,B,A format
offsetfloat0-100YesStop position along the gradient radius (percentage)

Note: Maximum 5 stop points are allowed.

Examples

"radial:50;50;50;50;50/255,255,255;0/0,0,0;100"
"radial:50;50;50;30;30;10/255,0,0;0/0,0,255;100"

Usage in API

Color formats are used in various endpoints:

  • QR Codes: background_color, foreground_color, outer_corner_color, inner_corner_color accept complex color formats (simple color, linear gradient, or radial gradient)
  • Page Components: Various appearance fields accept color formats
  • Templates: Design configuration fields may accept color formats

When a field accepts complex colors, you can use any of the three formats (simple color, linear gradient, or radial gradient). When a field accepts only simple colors, you must use the R,G,B or R,G,B,A format.