Context Free Art

Shape adjustments

From Context Free Art

Jump to: navigation, search

Contents

Shape Adjustments: Geometry and Color

There are two categories of shape adjustments: geometric and color.

Geometry Adjustments

The geometry of shapes is defined by a two dimensional affine transform which is represented internally as a matrix.

x num
translation along the x-axis by num
y num
translation along the y-axis by num
z num*
translation along the z-axis by num
size num
scale in x and y by num
size num1 num2
scale in x by num1 and in y by num2
size num1 num2 num3*
scale in x by num1, in y by num2, and in z by num3
rotate num
rotate in the x/y plane num degrees
flip num
reflect in x/y plane across a line through the origin at num degrees
skew num1 num2
shear transform in x/y plane num1 degrees from the y axis and num2 degrees from the x axis
* The z-axis position and scale are not stored in the affine transform matrix and do not affect the shape of objects. The z-axis position determines which shape is on top when they overlap.
Abbreviations: 'size' can be abreviated as 's', 'rotate' can be abbreviated as 'r', and 'flip' can be abbreviated as 'f'.

Color Adjustments

The color of a shape is represented by two points in the HSBA color space (HSB color plus alpha, or opacity). One point is the color that the shape is actually drawn in and the other point is a target that the drawing color trends toward. The HSBA coordinates are [0,360) for hue, [0,1] for saturation, [0,1] for brightness, and [0,1] for alpha (opacity).

hue num
add num to the drawing hue value, modulo 360
saturation num
range [-1,1]. If num<0 then change the drawing saturation num% toward 0. If num>0 then change the drawing saturation num% toward 1.
brightness num
range [-1,1]. If num<0 then change the drawing brightness num% toward 0. If num>0 then change the drawing brightness num% toward 1.
alpha num
range [-1,1]. If num<0 then change the drawing alpha num% toward 0. If num>0 then change the drawing alpha num% toward 1.
|hue num
add num to the target hue value, modulo 360
|saturation num
range [-1,1]. If num<0 then change the target saturation num% toward 0. If num>0 then change the target saturation num% toward 1.
|brightness num
range [-1,1]. If num<0 then change the target brightness num% toward 0. If num>0 then change the target brightness num% toward 1.
|alpha num
range [-1,1]. If num<0 then change the target alpha num% toward 0. If num>0 then change the target alpha num% toward 1.
Abbreviations: 'hue' can be abbreviated as 'h', 'saturation' can be abbreviated as 'sat', 'brightness' can be abbreviated as 'b', and 'alpha' can be abbreviated as 'a'.

Targeting a Color

There are four more drawing color adjustments for changing the drawing color components with respect to the target color. This useful is you have a recursive shape rule that adjusts a color component and you don't want to overshoot a value. For example, the drawing hue is red and you want the drawing hue to trend toward yellow, but never go past yellow to green.

hue num|
range [-1,1]. If num<0 then change the drawing hue num% toward the target hue moving clockwise around the color wheel. If num>0 then change the drawing hue num% toward the target hue counter-clockwise around the color wheel.
saturation num|
range [-1,1]. If num<0 then change the drawing saturation num% toward 0 or the target saturation, whichever is closer. If num>0 then change the drawing saturation num% toward 1 or the target saturation, whichever is closer.
brightness num|
range [-1,1]. If num<0 then change the drawing brightness num% toward 0 or the target brightness, whichever is closer. If num>0 then change the drawing brightness num% toward 1 or the target brightness, whichever is closer.
alpha num|
range [-1,1]. If num<0 then change the drawing alpha num% toward 0 or the target alpha, whichever is closer. If num>0 then change the drawing alpha num% toward 1 or the target alpha, whichever is closer.
Views
Personal tools
Navigation
Toolbox
MediaWiki
Attribution-Share Alike 2.5
book coverSee our new book:
Community of Variation