Skip to content

[Custom Highlight API Extensions] Color composition #1434

Open

Description

Robert Flack (@flackr) wrote:

For color specifically, if there’s overlapping higlights, we pick a single color

The painted color could be the result of compositing the colors in highlight order on top of the underlying color. These colors could each by partially translucent in order to apply subtle effects, e.g. black + highlight color rgba(255, 0, 0, 0.5) + highlight color rgba(0, 0, 255, 0.5) would result in rgb(64, 0, 127). This would allow them to not suddenly override colors mixing over time. The main thing you can't do with this is make it more transparent, which you could do with the opacity property.

Activity

  1. kbabbitt commented on Nov 3, 2026

    @kbabbitt
    MemberAuthor

    I might be misunderstanding your suggestion, but picking the topmost color is already spec'ed and shipped behavior, and I didn't want to mess with that. https://drafts.csswg.org/css-pseudo-4/#highlight-text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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