DePauwREU2013 / scales

2 stars 0 forks source link

Aliases for Fill, Stroke, and Outline #14

Closed mfansler closed 11 years ago

mfansler commented 11 years ago

Fill and Outline could use aliases.

I liked the tie operator -~ for editing stroke (outline) fill. Maybe giving a (Double, Paint) could manipulate both the stroke width and the paint color.

For Fill, perhaps -o could work?

I was further thinking that the -* could be overloaded with a -*(p: Paint) definition which would change both the outline and the fill to the specified paint.

mfansler commented 11 years ago

I ended up doing:

-* (Paint) for Fill -~ (Double) for Stroke -~ (Paint) for Outline -~ (Double, Paint) for Stroke and Outline -~* (Paint) for Fill and Outline combo

I updated the examples to use these, which I think makes most of them more readable. Now, when a graphic is declared it can usually be written primitive first, with modifiers like fill, scale, etc. pushed to the right. It also let me remove a few dozen parentheses.