Repository navigation
feat(plugin-color): add a multiply color action and sepia(amount) - #1517
Merged
Merged
Conversation
`color()` gets a `multiply` action that multiplies red, green and blue by three factors, or by a color (each channel / 255, like the multiply blend mode). `sepia()` takes an optional amount from 0 to 1 (default 1) that blends between the original image and full sepia. Fixes #1015 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
🚀 PR was released in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1015
The issue asks for filterous-style
rgbAdjust(per-channel multiply) andcolorFilter, plus a sepia intensity, to build Instagram-style filters.What changed
multiplycolor actionparamsis either three numeric factors[r, g, b], or a single color in the same formmix/xortake ({ r, g, b }0-255 or a CSS color, converted to the image's colour space). Invalid CSS colors throw (Invalid color "…"), per 2.0.[r, g, b]triple (like the issue'srgbAdjust([r, g, b])) so they can't be confused with an{ r, g, b }color, which is 0-255 everywhere else incolor(). A color means the multiply blend mode (factor = channel / 255), which can only darken; factors can also brighten.ColorActionNameasMULTIPLY.sepia(amount = 1)Blends between the original pixel (
0) and full sepia (1), like CSSfilter: sepia(amount). Out-of-range values are clamped to 0-1.sepia()/sepia(1)give byte-identical output to before.colorFilteris alreadymixfilterous's
colorFilter([r, g, b, adj])computesc - (c - color) * adj, which is exactlymixwith a weight ofadj * 100:so no new action is needed; the README shows it alongside
multiplyandsepia(amount).JSDoc examples, README and tests added (factors, rounding/clamping, color and
{ r, g, b }forms, invalid colors, sepia blend and clamping).🤖 Generated with Claude Code