summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/logo.sc40
-rw-r--r--docs/logo.svg1
-rw-r--r--readme.md2
3 files changed, 42 insertions, 1 deletions
diff --git a/docs/logo.sc b/docs/logo.sc
new file mode 100644
index 00000000..5d8cee3b
--- /dev/null
+++ b/docs/logo.sc
@@ -0,0 +1,40 @@
+import $ivy.`com.lihaoyi::scalatags:0.6.7`
+import scalatags.Text.implicits._
+import scalatags.Text.svgTags._
+import scalatags.Text.svgAttrs._
+import ammonite.ops._
+
+val svgWidth = 24
+val svgHeight = 24
+val numSections = 3
+val bandWidth = 16
+val bandGap = 8
+val screwPitch = 2.0
+
+def section(verticalOffset: Double) = {
+ val p = sectionLine(0).map{case (x, y) => (x, y + verticalOffset)}
+ val p1 = p.map{case (x, y) => (x, y - bandWidth/2)}
+ val p2 = p.map{case (x, y) => (x, y + bandWidth/2)}
+ (p1 ++ p2.reverse).map{case (x, y) => s"$x,$y"}.mkString(" ")
+}
+
+def sectionLine(startRadians: Double) = for{
+ y <- Seq(-svgHeight / 2, svgHeight / 2)
+} yield {
+ val x = -y * svgWidth / svgHeight
+ (x.toInt + svgWidth/2, y.toInt * screwPitch + svgHeight/2)
+}
+
+val sections = for(i <- -numSections/2 to numSections/2) yield polyline(
+ points := section(i * (bandWidth + bandGap)),
+ fill := "#666",
+)
+val svgFrag = svg(
+ xmlns := "http://www.w3.org/2000/svg",
+ height := svgHeight,
+ width := svgWidth
+)(
+ sections:_*
+)
+
+write.over(pwd/"logo.svg", "<!DOCTYPE html>" + svgFrag) \ No newline at end of file
diff --git a/docs/logo.svg b/docs/logo.svg
new file mode 100644
index 00000000..c7e288e9
--- /dev/null
+++ b/docs/logo.svg
@@ -0,0 +1 @@
+<!DOCTYPE html><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><polyline points="24,-44.0 0,4.0 0,20.0 24,-28.0" fill="#666"></polyline><polyline points="24,-20.0 0,28.0 0,44.0 24,-4.0" fill="#666"></polyline><polyline points="24,4.0 0,52.0 0,68.0 24,20.0" fill="#666"></polyline></svg> \ No newline at end of file
diff --git a/readme.md b/readme.md
index 20fd0bd9..d3b12917 100644
--- a/readme.md
+++ b/readme.md
@@ -1,5 +1,5 @@
-# Mill
+# ![Mill Logo](docs/logo.svg) Mill
Your shiny new Scala build tool!