Bug 408256

Summary: Missing closest color indication in new color palette docker
Product: [Applications] krita Reporter: Larpon <dev.larpon>
Component: Color SelectorsAssignee: Anna Medonosova <anna.medonosova>
Status: RESOLVED FIXED    
Severity: normal CC: anna.medonosova, halla
Priority: NOR    
Version: 4.2.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Larpon 2019-06-03 15:06:21 UTC
SUMMARY
In at least Krita version 4.1.x the color palette indicated what color was "closest" match to the current foreground color.

This feature seem to be let out in the new Color palette implementation?
The indication was done with a border around the color in the palette docker.

STEPS TO REPRODUCE
1. Use color selector tool on any layer
2. No color in the palette are raised/highlighted/marked

OBSERVED RESULT
No highlighting of colors when changing foreground color

EXPECTED RESULT
Highlight or marking of the color closest to the foreground color (like in Krita 4.1.x)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 18.04
Comment 1 Anna Medonosova 2019-06-07 04:15:28 UTC
Hi, Larpon,

in the new palette docker, the selection of closest color needs to be enabled specifically. To do that:

1, in the main menu select "Settings" -> "Configure Krita" -> "Color Management"
2, tick the checkbox labeled "Enforce palette colors: always select the nearest color from the active palette."

With that option turned on, does the palette docker function as expected?
Comment 2 Halla Rempt 2019-06-07 07:50:13 UTC
Ah, but that isn't what we want, I think. There are two functionalities:

* selecting the closest color from the current palette as the new fg/bg color.
* selecting the closest color to the current fg/bg color in the palette without changing the fg/bg color. I think that's what was working in 4.1.7.
Comment 3 Larpon 2019-06-07 08:07:23 UTC
Hi Anna and Boud,

Thanks for the workaround - I've completely missed that option.

Right now the color gets highlighted as I was missing - but as Boud mentioned in *2 - there was a feature where the fg wouldn't be set - but the highlight would still show around the color in the palette.

Thanks both of you!
Comment 4 Anna Medonosova 2019-06-14 10:31:21 UTC
Git commit c06107d673357cb9e8cb56771106770b5bc0f75a by Anna Medonosova.
Committed on 14/06/2019 at 10:30.
Pushed by amedonosova into branch 'master'.

Fix 'Enforce palette colors' feature

Since the 'Enforce palette colors' is a feature of the internal color
selector, this commit moves the functionality from KisPaletteView to
KisDlgInternalColorSelector. Also, that way the color change is forced
only once upon foreground color change, preventing cycling signals and confusing color changes
(KisPaletteView can be used more than once with different color palettes).

Removes KisPaletteView::slotFGColorResourceChanged, the function is
obsolete: it was meant to solve bug 402072 that is now fixed in a better way.

BACKPORT:krita/4.2
Related: bug 402072

M  +7    -2    libs/widgets/KisDlgInternalColorSelector.cpp
M  +7    -13   libs/widgets/kis_palette_view.cpp
M  +8    -6    libs/widgets/kis_palette_view.h
M  +1    -1    plugins/dockers/palettedocker/palettedocker_dock.cpp

https://invent.kde.org/kde/krita/commit/c06107d673357cb9e8cb56771106770b5bc0f75a
Comment 5 Halla Rempt 2019-06-17 08:18:06 UTC
Git commit 188dbe65a9b17a109835508d5691e6d56c3768b3 by Boudewijn Rempt, on behalf of Anna Medonosova.
Committed on 17/06/2019 at 08:17.
Pushed by rempt into branch 'krita/4.2'.

Fix 'Enforce palette colors' feature

Since the 'Enforce palette colors' is a feature of the internal color
selector, this commit moves the functionality from KisPaletteView to
KisDlgInternalColorSelector. Also, that way the color change is forced
only once upon foreground color change, preventing cycling signals and confusing color changes
(KisPaletteView can be used more than once with different color palettes).

Removes KisPaletteView::slotFGColorResourceChanged, the function is
obsolete: it was meant to solve bug 402072 that is now fixed in a better way.

BACKPORT:krita/4.2
Related: bug 402072

M  +7    -2    libs/widgets/KisDlgInternalColorSelector.cpp
M  +7    -13   libs/widgets/kis_palette_view.cpp
M  +8    -6    libs/widgets/kis_palette_view.h
M  +1    -1    plugins/dockers/palettedocker/palettedocker_dock.cpp

https://invent.kde.org/kde/krita/commit/188dbe65a9b17a109835508d5691e6d56c3768b3