Skip to content

Commit 6c4bd62

Browse files
authored
fix (color picker): display theme color value
1 parent b118f89 commit 6c4bd62

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/color-palette-control/color-palette-popup.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import { AdvancedToolbarControl } from '..'
66
import { i18n } from 'stackable'
7+
import { extractColor } from '~stackable/util'
78

89
/**
910
* WordPress dependencies
@@ -39,6 +40,8 @@ export const ColorPalettePopup = memo( props => {
3940
isGradient,
4041
} = props
4142

43+
const extractedValue = extractColor( value )
44+
4245
const [ tab, setTab ] = useState( value.startsWith( 'linear-' ) || value.startsWith( 'radial-' ) ? 'gradient' : '' )
4346
const allColors = colors.reduce( ( colors, group ) => {
4447
return [
@@ -87,7 +90,7 @@ export const ColorPalettePopup = memo( props => {
8790
onChange={ newValue => {
8891
onChange( preOnChange( newValue, value ) )
8992
} }
90-
color={ value }
93+
color={ extractedValue }
9194
enableAlpha={ true }
9295
/>
9396
}

0 commit comments

Comments
 (0)