Conversation
|
|
||
| const duotonePalette = useSetting( 'color.duotone' ); | ||
| const colorPalette = useSetting( 'color.palette' ); | ||
| const disableCustomColors = ! useSetting( 'color.custom' ); |
There was a problem hiding this comment.
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.
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.
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
|
|
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).