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
| Parameter | Type | Range | Required | Description |
|---|---|---|---|---|
R | integer | 0-255 | Yes | Red component |
G | integer | 0-255 | Yes | Green component |
B | integer | 0-255 | Yes | Blue component |
A | float | 0-1 | No | Alpha (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
| Parameter | Type | Range | Required | Description |
|---|---|---|---|---|
x1, y1 | float | 0-100 | Yes | Start point coordinates (percentage) |
x2, y2 | float | 0-100 | Yes | End point coordinates (percentage) |
color | string | - | Yes | Color value in R,G,B or R,G,B,A format |
offset | float | 0-100 | Yes | Stop 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
| Parameter | Type | Range | Required | Description |
|---|---|---|---|---|
cx, cy | float | 0-100 | Yes | Center point coordinates (percentage) |
r | float | 0-100 | Yes | Radius (percentage) |
fx, fy | float | 0-100 | Yes | Focal point coordinates (percentage) |
fr | float | 0-100 | No | Focal radius (percentage) |
color | string | - | Yes | Color value in R,G,B or R,G,B,A format |
offset | float | 0-100 | Yes | Stop 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_coloraccept 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.