timjs / elm-collage

Create interactive vector graphics and position them relative to each other
BSD 3-Clause "New" or "Revised" License
58 stars 19 forks source link

Transparent vs Invisible #18

Open gitLabor8 opened 6 years ago

gitLabor8 commented 6 years ago

When trying to make an invisible hitbox, I used

rectangle 10 10
|> filled transparent

However, this hitbox will not trigger any events. Using a color with opacity zero however will have the desired effect:

rectangle 10 10
|> filled (uniform (Color.rgba 0 0 0 0))

Please add a default fill style called "invisible" that mimics this behaviour and make a clear distinction with "transparent" in your documentation.

Kwarrtz commented 6 years ago

I might suggest something more descriptive like empty for the current behavior and transparent or invisible for the new suggested behavior.

timjs commented 6 years ago

I agree with both of you.

We currently have the following behaviour:

transparent : FillStyle -- no filling at all
invisible : LineStyle   -- no line at all

I'll change this in the next version to:

empty : FillStyle       -- no filling at all
none : LineStyle        -- no line at all
transparent : FillStyle -- has a filling, but with opacity of 0
invisible : LineStyle   -- has line, but with opacity of 0