Skip to content

Winding number fill rule with multiple colors #207

Open
@pnutus

Description

@pnutus

I'd like a fill rule that fills each region with a different color depending on the winding number. The current fillRule Winding is binary: either the winding number is zero and it doesn't fill the region, or it's non-zero and it does. I want something like

dia = loop # fillRule (WindingColors [red, blue, green, yellow])

which would cycle the colors like this

regionColor _ 0 = none
regionColor colorList n = colorList !! (n' `mod` length colorList)
  where
    n' = if (n > 0) then (n - 1) else n -- skips 0 for the cycling

(with winding number zero having no color).

I realise this might be a tall order, since it's not a standard graphics setting (there is no such thing in the SVG spec, for example). I'm posting it here anyway, since I think the idea is neat. :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions