This module creates svg gradient output for gradient.js modules.
gradient.js is a javascript module that takes your source colors array and configuration object, and returns a gradient suitable for your needs.
const svg = new Svg()
const gradient = svg.get([
[100, 34, 230, 0.5],
[10, 33, 20, 0.6],
[1, 12, 12, 0.3]
],{
base: {
interpolation: 'linear',
mode: 'rgb',
samples: 40,
lightnessCorrection: true
},
svg: {
type: 'radial',
cx: 0.5,
cy: 0.5,
r: 0.3,
spreadMethod: 'reflect'
}
},
)
{
type: 'linear' | 'radial'
id: sting
angle?: number
x1?: number
y1?: number
x2? number
y2?: number
cx?: number
cy?: number
r?: number
fx?: number
fy?: number
spreadMethod?: 'pad' | 'repeat' | 'reflect'
gradientUnits?: 'objectBoundingBox' | 'userSpaceOnUse'
}