Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blend Modes? #2

Closed
davelab6 opened this issue Feb 23, 2023 · 4 comments
Closed

Blend Modes? #2

davelab6 opened this issue Feb 23, 2023 · 4 comments

Comments

@davelab6
Copy link
Collaborator

Since COLRv1 supports blending modes (overlay, multiply etc) I wonder if you can use them in Bitcount to make some nice pattern effects :) GF will not otherwise have any showcasing for this. You may be interested to chat with @simoncozens about it

@davelab6
Copy link
Collaborator Author

Rod mentioned,

COLRv1 supports https://www.w3.org/TR/compositing-1/. In time we'll need an update for new modes, googlefonts/colr-gradients-spec#364.

@simoncozens
Copy link
Collaborator

To use composite blending, change the lines:

    for x, y in pixelPositions:
        layers.append(PaintTranslate(x, y, PaintGlyph(pixelGlyphName, layer1)))
        layers.append(PaintTranslate(x, y, PaintGlyph(pixelGlyphName, layer2)))

to

        layers.append(PaintTranslate(x, y, PaintComposite(
            "multiply",
            PaintGlyph(pixelGlyphName, layer1),
            PaintGlyph(pixelGlyphName, layer2),
        )))
Screenshot 2023-06-07 at 15 39 04

@davelab6
Copy link
Collaborator Author

davelab6 commented Apr 2, 2024

@petrvanblokland was this used?

@davelab6
Copy link
Collaborator Author

davelab6 commented Apr 3, 2024

No :) Its just a mask on the colours

@davelab6 davelab6 closed this as completed Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants