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

Fill color Transparent not working(it setting the black color) #14

Closed
shah-dhaval opened this issue Feb 13, 2018 · 3 comments
Closed

Fill color Transparent not working(it setting the black color) #14

shah-dhaval opened this issue Feb 13, 2018 · 3 comments
Labels

Comments

@shah-dhaval
Copy link
Contributor

Add any shape, set fill color to transparent, It is not setting the transparent but instead it setting the black color

@srkela srkela added the bug label Feb 19, 2018
@srkela
Copy link
Collaborator

srkela commented Feb 19, 2018

Hi Dhaval, thanks for reporting this issue. Seem to we have problem with rgba color in src/plugins/option-color/CorlorpickerControl.js

For some reason alpha is ignoring in rgba color. That's the reason why we have black background in shapes, instead of black with full transparency when choose transparent in color picker.

ColorpickerControl.prototype.TRANSPARENT = 'rgba(0, 0, 0, 0)';

It would be nice if someone could help to fix this bug.

@luispichio
Copy link

luispichio commented Mar 10, 2018

Hi guys!
In the file "Color.js" , when the event "_onColorSelected" is fired, "alpha" of selected color is replaced (in _hexToRgba function) by opacity value from "opacityControl", which is one when the opacity control is hidden (generally). Then the "transparent" (rgba(0,0,0,0)) turn black (rgba(0,0,0,1)).

2018-03-10 14_50_11-_new 14 - notepad

Suggestions to fix it:

  • Avoid to change alpha when:
    • opacity control is hidden
    • "selectedColor" is "transparent"
    • ...

I fixed it avoiding changing alpha when the opacity control is hidden (definitely not the most elegant solution).

2018-03-10 15_07_07-z__github_drawerjs_src_plugins_option-color_color js - notepad

See you!

srkela added a commit that referenced this issue Mar 14, 2018
created package-lock.json
@srkela
Copy link
Collaborator

srkela commented Mar 14, 2018

Hi Luis, thanks for contributing!

I've applied your fix and merged to master. Looks good, I didn't find any issues after applying the fix.

If you want to contribute more to the project going forward with fixes or some new features, you are free to work in your branch and create pull requests. Thanks!

Srdjan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants