File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -579,13 +579,26 @@ export const PaletteGenerator = GObject.registerClass(
579579 _extractColorsIM ( imagePath ) {
580580 this . _showLoading ( true ) ;
581581
582+ // Get currently locked colors before extraction
583+ const lockedColors = this . _swatchGrid . getLockedColors ( ) ;
584+ const currentPalette = [ ...this . _palette ] ;
585+
582586 extractColorsFromWallpaperIM (
583587 imagePath ,
584588 this . _lightMode ,
585589 colors => {
586- this . _originalPalette = [ ...colors ] ;
587- this . setPalette ( colors ) ;
588- this . emit ( 'palette-generated' , colors ) ;
590+ // Merge extracted colors with locked colors
591+ const mergedColors = colors . map ( ( color , index ) => {
592+ // Keep locked colors unchanged
593+ if ( lockedColors [ index ] && currentPalette [ index ] ) {
594+ return currentPalette [ index ] ;
595+ }
596+ return color ;
597+ } ) ;
598+
599+ this . _originalPalette = [ ...mergedColors ] ;
600+ this . setPalette ( mergedColors ) ;
601+ this . emit ( 'palette-generated' , mergedColors ) ;
589602 this . _showLoading ( false ) ;
590603 } ,
591604 error => {
You can’t perform that action at this time.
0 commit comments