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

When swapping colors a fully transparent color (alpha=0) is changed to be fully opaque (alpha=255) #364

Closed
LiquidFun opened this issue Oct 23, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@LiquidFun
Copy link

Alright, it's me again :D

Pixelorama version: v0.8.2-dev, Commit "Fixes #363" (df7a650) (latest)

OS/device including version: Arch Linux

Issue description:

If one of the colors is fully transparent when swapping between the left-tool color and right-tool color it will become fully opaque.

Steps to reproduce:

Click on one color and drag the alpha slider to 0, then press x or on the two-sided arrows to swap the colors.

I see why it happens here:

func assign_color(color : Color, button : int) -> void:
var c : Color = _slots[button].color
if color.a == 0:
if color.r != c.r or color.g != c.g or color.b != c.b:
color.a = 1
_slots[button].color = color
Global.config_cache.set_value(_slots[button].kname, "color", color)
emit_signal("color_changed", color, button)

But I can't say I understand the reasoning behind that if statement? At least the swapping behaviour is not what one might expect from other software.

@LiquidFun LiquidFun added the bug Something isn't working label Oct 23, 2020
@OverloadedOrama
Copy link
Member

I think that this behavior comes from suggestion #54, but I did not realize that this piece of code also affects swapping. I will fix this so swapping will work as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants