Make a CSS gradient
make_gradientBuild CSS gradients from 2+ colors using OKLab, OKLCH, or sRGB interpolation, returning modern CSS plus fallback stops. Use OKLab to avoid gray midpoints in sRGB gradients.
Instructions
Build a CSS gradient from 2 or more colors with interpolation in OKLab, OKLCH or sRGB. Returns modern CSS with the color space, a fallback with precomputed stops for older browsers, and the stop colors. OKLab avoids the gray middle that sRGB gradients get.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | linear | |
| angle | No | Angle in degrees for linear | |
| space | No | oklab | |
| stops | No | How many precomputed stops the fallback gets | |
| colors | Yes | Gradient stops in order, 2 to 12 |