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

Shadow color not working as expected #1036

Open
Pmleader opened this issue Nov 4, 2014 · 0 comments
Open

Shadow color not working as expected #1036

Pmleader opened this issue Nov 4, 2014 · 0 comments

Comments

@Pmleader
Copy link

Pmleader commented Nov 4, 2014

When using shadowColor(rgba()) on a shape it correctly displays a shadow in the specified color on the canvas.

var rect = new Kinetic.Rect({
        x: 250,
        y: 120,
        width: 100,
        height: 50,
        fill: '#00D2FF',
        stroke: 'black',
        strokeWidth: 3,
        shadowColor: 'rgba(255,0,0,0.3)',
        shadowBlur: 10,
        shadowOffset: {x:10,y:10},
        draggable:true
      });

However when you try to specify the separate channels for the shadow it does not use the color values you specify

var rect = new Kinetic.Rect({
        x: 250,
        y: 120,
        width: 100,
        height: 50,
        fill: '#00D2FF',
        stroke: 'black',
        strokeWidth: 3,
        shadowRed: 255, 
        shadowGreen: 0,
        shadowBlue: 0,
        shadowAlpha: 0.3,
        shadowBlur: 10,
        shadowOffset: {x:10,y:10},
        draggable:true
      });

You are also not able to alter a singe color channel in an event because of this bug.
For example:

rect.on('mousedown', function() {
        rect.shadowAlpha(0.8);
        stage.draw();
      });

Here you can find a JSFiddle which replicates the issue

This behaviour is present in all browsers, tested with KineticJS 5.1.0

If you need more information feel free to message me.

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

No branches or pull requests

1 participant