how do i start using paper.js

185 views
Skip to first unread message

Rob SaysHello

unread,
Aug 11, 2015, 12:49:55 PM8/11/15
to Paper.js
Hi im coming to this from scriptographer and Illustrator CC

I dont understand how to start using the scripts in html.

i have illustrator files and i want to use the script that picks up average colour from shape.

how do i use paper.js to do this?

simply, because ive spent an hour or so trying with the tutorials and cant figure anything out.

cheers

Alex Mills

unread,
Aug 12, 2015, 2:36:02 PM8/12/15
to Paper.js
Getting the average color should be pretty simple using a raster object.

Create the raster object.
var raster = new Raster('/images/mona.jpg');

raster.fitBounds(view.bounds, true);

Get the average color
raster.getAverageColor(view.bounds);

You can set the average color to a variable and then use that color how you would like.
var newAverageColor = raster.getAverageColor(view.bounds);

Nazar Bartosik

unread,
Aug 26, 2015, 10:36:27 AM8/26/15
to Paper.js
I'm not sure how relevant it is for your particular case, but I've come across a quite concise introductory tutorial about Paper.js.

Cheers, Nazar.
Reply all
Reply to author
Forward
0 new messages