Git Product home page Git Product logo

Comments (3)

srkela avatar srkela commented on May 22, 2024

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.

from drawerjs.

luispichio avatar luispichio commented on May 22, 2024

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!

from drawerjs.

srkela avatar srkela commented on May 22, 2024

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

from drawerjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.