Skip to content

[filter-effects-1] How to handle feColorMatrix with type=saturate and values outside a 0..1 range? #364

Open
@RazrFalcon

Description

@RazrFalcon

SVG 1.1 spec states that:

For type="saturate", ‘values’ is a single real number value (0 to 1).

but in Filter Effects Module Level 1:

Values outside the 0..1 range under- or oversaturates the filter input image respectively.

And the real results are even more strange:

<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
    <linearGradient id="lg1">
        <stop offset="0" stop-color="#cc00cc"/>
        <stop offset=".33" stop-color="#228822"/>
        <stop offset=".67" stop-color="#400000"/>
        <stop offset="1" stop-color="#a0a0ff"/>
    </linearGradient>
    <filter id="filter1">
        <feColorMatrix type="saturate" values="-0.5"/>
    </filter>
    <rect x="20" y="20" width="160" height="160" fill="url(#lg1)" filter="url(#filter1)"/>
</svg>

e-feColorMatrix-008

And with values="99999":

e-feColorMatrix-009

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions