Documentation
    Preparing search index...

    Interface ConicGradientPaint

    A §58 conic gradient: colour as a function of the polar angle around center, both in the shape's local space (see LinearGradientPaint for the space and the stop rules).

    Offset 0 sits on the ray from center at startAngle from +X; offsets increase counter-clockwise — right-handed Y-up (§7a), which is atan2(y, x) of the local offset, the same number §60's angle operator returns. The parameter wraps: past the last stop the ramp continues from the first, via fract. A zero-length offset (the exact centre) reads angle 0 in the JS meaning tests; a GPU may pick any direction for atan2(0, 0).

    const wheel: ConicGradientPaint = {
    kind: "conic-gradient",
    center: { x: 0, y: 0 },
    startAngle: 0,
    stops: [
    { offset: 0, color: [1, 0, 0, 1] },
    { offset: 1, color: [0, 0, 1, 1] },
    ],
    };
    interface ConicGradientPaint {
        center: Point2D;
        kind: "conic-gradient";
        opacity?: number;
        startAngle?: number;
        stops: readonly GradientStop[];
    }
    Index
    center: Point2D

    The gradient's centre, in local space; finite (§85).

    kind: "conic-gradient"

    Discriminant (§58 "conic gradient").

    opacity?: number

    See SolidPaint.opacity; multiplies every stop's alpha.

    startAngle?: number

    Angle, in radians (§7a), at which offset 0 is read — measured from +X, increasing counter-clockwise. Finite (§85); defaults to 0. Values outside [0, 2π) wrap with the parameter, they are not refused.

    stops: readonly GradientStop[]

    At least two sorted stops (§85) — see GradientStop.