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

Add all color palettes to select from editor panel #65148

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,27 @@ import { useSettings } from '../use-settings';

export default createHigherOrderComponent( ( WrappedComponent ) => {
return ( props ) => {
const [ colorsFeature, enableCustomColors ] = useSettings(
'color.palette',
'color.custom'
// Get the default colors, theme colors, and custom colors
const [
defaultColors,
themeColors,
customColors,
enableCustomColors,
enableDefaultColors,
] = useSettings(
'color.palette.default',
'color.palette.theme',
'color.palette.custom',
'color.custom',
'color.defaultPalette'
);
const {
colors = colorsFeature,
disableCustomColors = ! enableCustomColors,
} = props;

const colors = enableDefaultColors
? themeColors.concat( defaultColors, customColors )
: themeColors.concat( customColors );

const { disableCustomColors = ! enableCustomColors } = props;
AKSHAT2802 marked this conversation as resolved.
Show resolved Hide resolved

const hasColorsToChoose =
( colors && colors.length > 0 ) || ! disableCustomColors;
return (
Expand Down
Loading