Sg2.9
Can Scriptographer "know" the...
Recent RSS
Can Scriptographer "know" the brightness/value of a texture?
From:  jameswlf
Date:  20. November 2013, 07:54

As in the brightness of a color, but of a vector texture (the ones you load and apply to shapes from a swatch in your palette)?

Is there a way of doing that?

Re: Can Scriptographer "know" the brightness/value of a texture?
From:  pqbd
Date:  20. November 2013, 16:54

If you mean the average color of a pattern swatch, sure.

You can copy a swatch's definition to a document with:

document.swatches["SwatchName"].color.pattern.defninition.copyTo(document);

This should return a group whose last child is the clipping path. From there you can rasterize a clone of the group and get the average color within the clipping path.

Re: Can Scriptographer "know" the brightness/value of a texture?
From:  Jameswlf
Date:  14. December 2013, 02:50

Thanks!!! This is all I need.

I thought no one was going to answer, since this board seems dead, but I came back today to this project and I was glad to find your answer pqbd.

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Hexagonal Rasterizer 02.03.14