Documentation
    Preparing search index...

    Interface ColorGradeEffect

    §70's "color grading": exposure, contrast, and saturation over the source, in the order named here.

    { kind: "grade", exposure: 1.2, contrast: 1.1, saturation: 0.85 }
    

    Every field is optional and defaults to 1 — the identity value of its operation — so { kind: "grade" } is a copy with three multiplies, and a grade that names one field leaves the other two exactly alone. See COLOR_GRADE_DEFAULTS.

    The pipeline is linear-light on the GPU backends (§60a), and these operate on the values as stored — there is no perceptual curve in this tier, because the output transform that would supply one is staged (see the module header). Stated as arithmetic, per colour channel, with a untouched throughout:

    1. exposure — rgb *= exposure. A linear-light scale, so 2 is one stop brighter, not "twice as bright" perceptually.
    2. contrast — rgb = (rgb - 0.5) * contrast + 0.5. The pivot is 0.5 linear, which is not perceptual mid-grey; the pivot moves to mid-grey when §60a's transform lands, and that is a deliberate difference recorded here rather than a rounding of it.
    3. saturation — rgb = mix(vec3(luma), rgb, saturation), with luma the Rec. 709 linear-light weighted sum (0.2126 R + 0.7152 G + 0.0722 B); 0 is greyscale, 1 is unchanged, above 1 oversaturates.

    Nothing is clamped by the effect: the destination surface's format does the clamping it does (rgba8 saturates), and a float target — when R-4's format union widens — will not. Alpha is never touched, so an effect pass over a target with a transparent background composites afterwards exactly as the source would have.

    interface ColorGradeEffect {
        contrast?: number;
        exposure?: number;
        kind: "grade";
        saturation?: number;
    }
    Index
    contrast?: number

    Contrast about a linear 0.5 pivot; defaults to 1. Finite, >= 0.

    exposure?: number

    Linear-light multiplier; defaults to 1. Finite and >= 0 (§85).

    kind: "grade"

    Required, and the only value — the discriminant.

    saturation?: number

    0 greyscale … 1 unchanged … above oversaturates. Finite, >= 0.