Skip to content

[css-color-6] add color functions for some (or all) compositing/blending operations #8431

@dbaron

Description

@dbaron

In #7358 (comment) @LeaVerou wrote:

Whatever default we pick, there will be cases where it's wrong, so it would be nice to offer a way out. How can the author select what the background is composited on? What if we add a color-over() function to do alpha compositing? Pretty sure there are other use cases for it too, and it should be relatively easy to implement.

In today's telecon, for the same reason (and I think not having read Lea's comment) I suggested something similar:

<dbaron> Seems like what Adam's suggesting could also be done with a composite(A over B) color function or similar rather than additional syntax for the contrast function.

In other words, what I was thinking was roughly a composite( <color> <composite-mode> <color> ) function, which has a slightly larger feature space. (Except I didn't want <composite-mode> exactly, because I'd rather not have the source- and dest- prefixes in this case.)

But it's possible we might also want to allow choosing the <blend-mode>.

Opening this issue because it seems like this side discussion probably deserves its own issue, and we can decide whether or not we actually want such a feature.

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