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

I think the script isn't working anymore. #1

Open
LukyVj opened this issue Sep 22, 2014 · 2 comments
Open

I think the script isn't working anymore. #1

LukyVj opened this issue Sep 22, 2014 · 2 comments

Comments

@LukyVj
Copy link

LukyVj commented Sep 22, 2014

Hey, first of all, thank you for your script, it seems cool and useful.
The only thing is, I don't get it working.

I tried to .averageColor() a canvas, with an image in it, and the response is Object {r: 0, g: 0, b: 0}I tried to .averageColor() an image, and the response is Object {r: 0, g: 0, b: 0}

I tried with .averageColorAsString(), but same everywhere..

Could you tell me what is not working ?

@andreasnymark
Copy link

On line 27 and 28, change to this (notice the height() and width()):

    height = canvas.height = this.naturalHeight || this.offsetHeight || this.height();
    width  = canvas.width  = this.naturalWidth  || this.offsetWidth  || this.width();

@entozoon
Copy link

entozoon commented Sep 4, 2015

Bit of an old thread, but you might want to use a similar (but more advanced and actually working) plugin I've written:
https://github.com/entozoon/averagecolor

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

3 participants