-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add option to disable duotone #32002
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
Conversation
|
|
||
| const duotonePalette = useSetting( 'color.duotone' ); | ||
| const colorPalette = useSetting( 'color.palette' ); | ||
| const disableCustomColors = ! useSetting( 'color.custom' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we inverse this? It reads more nicely without the double negative:
const customColors = useSetting( 'color.custom' ); // or enableCustomColors
///...
{ customColors && (
<CustomDuotoneBar value={ value } onChange={ onChange } />
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was keeping things consistent with how PanelColorGradientSettings works, but keeping that consistency probably doesn't matter that much
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting, this one does personally read a bit awkwardly, but It's non-blocking if we're intentionally following this pattern.
|
Transform from image to cover seems to have that same error even when duotone isn't disabled. I'm looking into a fix that I'll open up in another PR EDIT: added #32006 |
|
Size Change: +67 B (0%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
The test failure is already on trunk and is being investigated, so I'm merging this one. |
|
❤️ |




Description
Fixes #31764
This allows for duotone to be disabled when
color.duotoneis set tonullin theme.json as well as respecting settings whencolor.custom === falseandcolor.palette === null.How has this been tested?
Change settings in theme.json as shown below in the screenshots section.
Screenshots
{ "version": 1, "settings": { "color": { "custom": true, "duotone": [], "palette": [] } } }{ "version": 1, "settings": { "color": { "custom": false, "duotone": [], "palette": [] } } }{ "version": 1, "settings": { "color": { "custom": true, "duotone": [], "palette": null } } }{ "version": 1, "settings": { "color": { "custom": false, "duotone": [], "palette": null } } }{ "version": 1, "settings": { "color": { "duotone": null } } }Types of changes
New feature / Bug fix
Checklist:
*.native.jsfiles for terms that need renaming or removal).