question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Alpha values of RGBA color tuples are ignored

See original GitHub issue

Thank you very much for providing this awesome library. Unfortunately, I found a bug concerning the handling of the transparency values in RGBA colour tuples. The alpha value is simply being ignored, as

print(sns.color_palette([(1,1,1,0)])) only results in the following output:

[(1.0, 1.0, 1.0)]

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Huiicommented, Feb 25, 2020

Thank you very much for your reply. I would still prefer to be able to set the alpha value myself. Otherwise, I wouldn’t, for example, be able to create a scatterplot with varying degrees of transparency for different categories.

Related to that, it would maybe be a good idea to change the following line of code: https://github.com/mwaskom/seaborn/blob/88479dc3a9c5dee00fa697fda73152add0827fc4/seaborn/relational.py#L937 to allow for setting the alpha value in relation to the hue value. What’s your opinion on that?

0reactions
marquez85commented, Sep 24, 2022

I subscribe also to this feature request.

It is something that is missing in the current seaborn package

Read more comments on GitHub >

github_iconTop Results From Across the Web

Convert RGBA tuple to hex with matplotlib - Stack Overflow
This is how I would do it: convert the RBG/HEX color to HSL, then modify L (the lightness) and finally bring it back...
Read more >
Premultiplied Alpha - Nigel Tao
NPA (Non-Premultiplied Alpha), also known as unassociated alpha or straight alpha, assumes that the RGB values are independent of the A value. A ......
Read more >
Specifying Colors — Matplotlib 3.1.0 documentation
Matplotlib recognizes the following formats to specify a color: an RGB or RGBA (red, green, blue, alpha) tuple of float values in [0, ......
Read more >
Alpha compositing - Wikipedia
RGBA tuples, a pixel value of (0, 0.7, 0, 0.5) implies a pixel that has 70% of the maximum green intensity and 50%...
Read more >
How do you set the alpha of a color??? - Python Forum
Pygame draw rect does not use alpha. It will accept the color values. But it will always ignore alpha. You can also darken...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found