Falk Joensson's
Eas (Easy Application Script)

Rendering 2D Drawings:05. Changing the Pen

DRAW'PEN:0 turns off drawing shape lines and curves (e.g. for only filling closed shapes) DRAW'PEN! all future-drawn shape lines and curves will be in black and 1 pixel thick DRAW'PEN:t 1 c "#0" s 0 d o defines how all future shape lines and curves will be drawn from now on the line thickness t is given either in pixels or as a percentage-string, where "100%" is a very thick line and very low values (even "0%") result in a thickness of 1 pixel the line color c is given as either a string of the CSS'COLA formats #X #XA #RGB #RGBA #RRGGBB #RRGGBBAA or a CSS color mixer string of the formats rgb(RRR,GGG,BBB) rgba(RRR,GGG,BBB,AAA) which can be generated with CSS'COLA the line style s selects from: 0 = round ends, rounded corners 1 = round ends, pointy corners 2 = flat ends, rounded corners 3 = flat ends, pointy corners 4 = flat ends, flat corners where edges would become excessively pointy, they will be displayed as flat edges instead
the line dashing d is given as either a vector or a \W-separated string (\W means any character but [a-zA-Z0-9_]) or a single number the values define a dash sequence of draw,gap sections of the line; odd-count sequences will be doubled, so the single value 5 equals (5 5) the values of the draw and gap sizes define multiples of the line width; dashing is best used with line style 3 or 4 also, distances of 1 may not be visible due to internal rounding of pixel positions, so better use draw/gap distances of 2 up the dashing offset o defines in percent of one whole dashing sequence how much the dashing is pushed further from the first towards the next point negative values move it backwards
05. Changing the Pen
D Download Eas 4B
O Donate
C Contact
Esc Search / Table of Contents