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

Do not blend color in QtColorBox with black using opacity #5827

Merged
merged 2 commits into from
May 15, 2023

Conversation

ksofiyuk
Copy link
Contributor

@ksofiyuk ksofiyuk commented May 11, 2023

Description

For some reason that I cannot fully understand, the displayed color in QtColorBox is multiplied with the layer opacity, which is equal to blending the selected color with black. I find it very misleading as it just distorts displayed colors making them harder to associate with the true colors. It becomes especially confusing when you use low levels of opacity (20-30%), which makes all colors look grey and indistinguishable.

How it now looks like in napari depending on different opacity:
image

This PR just removes it making it always show the actual color.

P.S. It has been puzzling me for a while why colors are always darker than the real colors in the color box. I've only recently realized that their appearance is depending on the opacity.

Type of change

  • Bug-fix (non-breaking change which fixes an issue)

Final checklist:

  • My PR is the minimum possible work for the desired functionality

@github-actions github-actions bot added the qt Relates to qt label May 11, 2023
@Czaki Czaki added the bugfix PR with bugfix label May 12, 2023
@Czaki Czaki added this to the 0.4.18 milestone May 12, 2023
@Czaki
Copy link
Collaborator

Czaki commented May 12, 2023

There is a need to update tests also

@github-actions github-actions bot added the tests Something related to our tests label May 12, 2023
@ksofiyuk
Copy link
Contributor Author

There is a need to update tests also

Fixed

@codecov
Copy link

codecov bot commented May 12, 2023

Codecov Report

Merging #5827 (6295747) into main (3868f5c) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #5827      +/-   ##
==========================================
+ Coverage   89.86%   89.91%   +0.04%     
==========================================
  Files         615      615              
  Lines       52474    52473       -1     
==========================================
+ Hits        47158    47182      +24     
+ Misses       5316     5291      -25     
Impacted Files Coverage Δ
.../_qt/layer_controls/_tests/test_qt_labels_layer.py 100.00% <ø> (ø)
napari/_qt/layer_controls/qt_labels_controls.py 92.04% <100.00%> (-0.04%) ⬇️

... and 6 files with indirect coverage changes

@Czaki Czaki added the ready to merge Last chance for comments! Will be merged in ~24h label May 12, 2023
@brisvag brisvag merged commit 903cbb2 into napari:main May 15, 2023
34 checks passed
@brisvag brisvag changed the title Do not blend color in QtColorBox with black using opacity (UI suggestion; bugfix? ) Do not blend color in QtColorBox with black using opacity May 15, 2023
@brisvag brisvag removed the ready to merge Last chance for comments! Will be merged in ~24h label May 15, 2023
@Czaki Czaki mentioned this pull request Jun 7, 2023
Czaki pushed a commit that referenced this pull request Jun 19, 2023
…ion; bugfix? ) (#5827)

# Description
For some reason that I cannot fully understand, the displayed color in
QtColorBox is multiplied with the layer opacity, which is equal to
blending the selected color with black. I find it very misleading as it
just distorts displayed colors making them harder to associate with the
true colors. It becomes especially confusing when you use low levels of
opacity (20-30%), which makes all colors look grey and
indistinguishable.

How it now looks like in napari depending on different opacity:

![image](https://github.com/napari/napari/assets/5459767/01b55cfd-6ce4-494d-a0fa-a8116ee35d6b)

This PR just removes it making it always show the actual color.

P.S. It has been puzzling me for a while why colors are always darker
than the real colors in the color box. I've only recently realized that
their appearance is depending on the opacity.

## Type of change
- [X] Bug-fix (non-breaking change which fixes an issue)

## Final checklist:
- [X] My PR is the minimum possible work for the desired functionality
Czaki pushed a commit that referenced this pull request Jun 21, 2023
…ion; bugfix? ) (#5827)

# Description
For some reason that I cannot fully understand, the displayed color in
QtColorBox is multiplied with the layer opacity, which is equal to
blending the selected color with black. I find it very misleading as it
just distorts displayed colors making them harder to associate with the
true colors. It becomes especially confusing when you use low levels of
opacity (20-30%), which makes all colors look grey and
indistinguishable.

How it now looks like in napari depending on different opacity:

![image](https://github.com/napari/napari/assets/5459767/01b55cfd-6ce4-494d-a0fa-a8116ee35d6b)

This PR just removes it making it always show the actual color.

P.S. It has been puzzling me for a while why colors are always darker
than the real colors in the color box. I've only recently realized that
their appearance is depending on the opacity.

## Type of change
- [X] Bug-fix (non-breaking change which fixes an issue)

## Final checklist:
- [X] My PR is the minimum possible work for the desired functionality
Czaki pushed a commit that referenced this pull request Jun 21, 2023
…ion; bugfix? ) (#5827)

# Description
For some reason that I cannot fully understand, the displayed color in
QtColorBox is multiplied with the layer opacity, which is equal to
blending the selected color with black. I find it very misleading as it
just distorts displayed colors making them harder to associate with the
true colors. It becomes especially confusing when you use low levels of
opacity (20-30%), which makes all colors look grey and
indistinguishable.

How it now looks like in napari depending on different opacity:

![image](https://github.com/napari/napari/assets/5459767/01b55cfd-6ce4-494d-a0fa-a8116ee35d6b)

This PR just removes it making it always show the actual color.

P.S. It has been puzzling me for a while why colors are always darker
than the real colors in the color box. I've only recently realized that
their appearance is depending on the opacity.

## Type of change
- [X] Bug-fix (non-breaking change which fixes an issue)

## Final checklist:
- [X] My PR is the minimum possible work for the desired functionality
Czaki pushed a commit that referenced this pull request Jun 21, 2023
…ion; bugfix? ) (#5827)

# Description
For some reason that I cannot fully understand, the displayed color in
QtColorBox is multiplied with the layer opacity, which is equal to
blending the selected color with black. I find it very misleading as it
just distorts displayed colors making them harder to associate with the
true colors. It becomes especially confusing when you use low levels of
opacity (20-30%), which makes all colors look grey and
indistinguishable.

How it now looks like in napari depending on different opacity:

![image](https://github.com/napari/napari/assets/5459767/01b55cfd-6ce4-494d-a0fa-a8116ee35d6b)

This PR just removes it making it always show the actual color.

P.S. It has been puzzling me for a while why colors are always darker
than the real colors in the color box. I've only recently realized that
their appearance is depending on the opacity.

## Type of change
- [X] Bug-fix (non-breaking change which fixes an issue)

## Final checklist:
- [X] My PR is the minimum possible work for the desired functionality
@ksofiyuk ksofiyuk deleted the bugfix_no_blending_in_colorbox branch January 8, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR with bugfix qt Relates to qt tests Something related to our tests UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants