Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions textures.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ umd ->
circles: () ->
size = 20
background = ""
backgroundOpacity = 1
radius = 2
complement = false
fill = "#343434"
fillOpacity = 1
stroke = "#343434"
strokeWidth = 0
strokeOpacity = 1
id = rand()

circles = () ->
Expand All @@ -43,14 +46,17 @@ umd ->
width: size
height: size
fill: background
"fill-opacity": backgroundOpacity
g.append "circle"
.attr
cx: size / 2
cy: size / 2
r: radius
fill: fill
"fill-opacity": fillOpacity
stroke: stroke
"stroke-width": strokeWidth
"stroke-opacity": strokeOpacity
if complement
for corner in [ [ 0, 0 ], [ 0, size ], [ size, 0 ], [ size, size ] ]
g.append "circle"
Expand All @@ -59,8 +65,10 @@ umd ->
cy: corner[1]
r: radius
fill: fill
"fill-opacity": fillOpacity
stroke: stroke
"stroke-width": strokeWidth
"stroke-opacity": strokeOpacity

circles.heavier = (_) ->
if not arguments.length
Expand Down Expand Up @@ -94,6 +102,10 @@ umd ->
background = _
circles

circles.backgroundOpacity = (_) ->
backgroundOpacity = _
circles

circles.size = (_) ->
size = _
circles
Expand All @@ -110,6 +122,10 @@ umd ->
fill = _
circles

circles.fillOpacity = (_) ->
fillOpacity = _
circles

circles.stroke = (_) ->
stroke = _
circles
Expand All @@ -118,6 +134,10 @@ umd ->
strokeWidth = _
circles

circles.strokeOpacity = (_) ->
strokeOpacity = _
circles

circles.id = (_) ->
if not arguments.length
id
Expand All @@ -137,8 +157,10 @@ umd ->
size = 20
strokeWidth = 2
stroke = "#343434"
strokeOpacity = 1
id = rand()
background = ""
backgroundOpacity = 1
orientation = ["diagonal"]
shapeRendering = "auto"

Expand Down Expand Up @@ -190,19 +212,25 @@ umd ->
width: size
height: size
fill: background
"fill-opacity": backgroundOpacity
for o in orientation
g.append "path"
.attr
d: path o
"stroke-width": strokeWidth
"shape-rendering": shapeRendering
stroke: stroke
"stroke-opacity": strokeOpacity
"stroke-linecap": "square"

lines.background = (_) ->
background = _
lines

lines.backgroundOpacity = (_) ->
backgroundOpacity = _
lines

lines.shapeRendering = (_) ->
shapeRendering = _
lines
Expand Down Expand Up @@ -247,6 +275,10 @@ umd ->
stroke = _
lines

lines.strokeOpacity = (_) ->
strokeOpacity = _
lines

lines.strokeWidth = (_) ->
strokeWidth = _
lines
Expand All @@ -272,7 +304,9 @@ umd ->
width = 1
strokeWidth = 2
stroke = "#343434"
strokeOpacity = 1
background = ""
backgroundOpacity = 1
d = ""
shapeRendering = "auto"
fill = "transparent"
Expand Down Expand Up @@ -328,19 +362,25 @@ umd ->
width: size * width
height: size * height
fill: background
"fill-opacity": backgroundOpacity
g.append "path"
.attr
d: path
fill: fill
"stroke-width": strokeWidth
"shape-rendering": shapeRendering
stroke: stroke
"stroke-opacity": strokeOpacity
"stroke-linecap": "square"

paths.background = (_) ->
background = _
paths

paths.backgroundOpacity = (_) ->
backgroundOpacity = _
paths

paths.shapeRendering = (_) ->
shapeRendering = _
paths
Expand Down Expand Up @@ -389,6 +429,10 @@ umd ->
strokeWidth = _
paths

paths.strokeOpacity = (_) ->
strokeOpacity = _
paths

paths.id = (_) ->
if not arguments.length
id
Expand Down
62 changes: 53 additions & 9 deletions textures.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading