Skip to content

Instantly share code, notes, and snippets.

@pascalc
Last active December 23, 2015 18:29
Show Gist options
  • Save pascalc/6676598 to your computer and use it in GitHub Desktop.
Save pascalc/6676598 to your computer and use it in GitHub Desktop.
(clear!)
(def colors
["aliceblue",
"antiquewhite",
"aqua(Safe 16 Hex3)",
"aquamarine",
"azure",
"beige",
"bisque",
"black(Safe 16 Hex3)",
"blanchedalmond",
"blue(Safe 16 Hex3)",
"blueviolet",
"brown",
"burlywood",
"cadetblue",
"chartreuse",
"chocolate",
"coral",
"cornflowerblue",
"cornsilk",
"crimson",
"cyan(Safe 16=aqua Hex3)",
"darkblue",
"darkcyan",
"darkgoldenrod",
"darkgray",
"darkgreen",
"darkgrey",
"darkkhaki",
"darkmagenta",
"darkolivegreen",
"darkorange",
"darkorchid",
"darkred",
"darksalmon",
"darkseagreen",
"darkslateblue",
"darkslategray",
"darkslategrey",
"darkturquoise",
"darkviolet",
"deeppink",
"deepskyblue",
"dimgray",
"dimgrey",
"dodgerblue",
"firebrick",
"floralwhite",
"forestgreen",
"fuchsia(Safe 16 Hex3)",
"gainsboro",
"ghostwhite",
"gold",
"goldenrod",
"gray(16)",
"green(16)",
"greenyellow",
"grey(16)",
"honeydew",
"hotpink",
"indianred",
"indigo",
"ivory",
"khaki",
"lavender",
"lavenderblush",
"lawngreen",
"lemonchiffon",
"lightblue",
"lightcoral",
"lightcyan",
"lightgoldenrodyellow",
"lightgray",
"lightgreen",
"lightgrey",
"lightpink",
"lightsalmon",
"lightseagreen",
"lightskyblue",
"lightslategray(Hex3)",
"lightslategrey(Hex3)",
"lightsteelblue",
"lightyellow",
"lime(Safe 16 Hex3)",
"limegreen",
"linen",
"magenta(Safe 16=fuchsia Hex3)",
"maroon(16)",
"mediumaquamarine",
"mediumblue",
"mediumorchid",
"mediumpurple",
"mediumseagreen",
"mediumslateblue",
"mediumspringgreen",
"mediumturquoise",
"mediumvioletred",
"midnightblue",
"mintcream",
"mistyrose",
"moccasin",
"navajowhite",
"navy(16)",
"oldlace",
"olive(16)",
"olivedrab",
"orange",
"orangered",
"orchid",
"palegoldenrod",
"palegreen",
"paleturquoise",
"palevioletred",
"papayawhip",
"peachpuff",
"peru",
"pink",
"plum",
"powderblue",
"purple(16)",
"red(Safe 16 Hex3)",
"rosybrown",
"royalblue",
"saddlebrown",
"salmon",
"sandybrown",
"seagreen",
"seashell",
"sienna",
"silver(16)",
"skyblue",
"slateblue",
"slategray",
"slategrey",
"snow",
"springgreen",
"steelblue",
"tan",
"teal(16)",
"thistle",
"tomato",
"turquoise",
"violet",
"wheat",
"white(Safe 16 Hex3)",
"whitesmoke",
"yellow(Safe 16 Hex3)",
"yellowgreen"])
(for-each [r (integers :from 800 :to 0 :step -20)]
(circle
(position "50%" "50%")
(radius r)
(stroke-width 3)
(stroke "black")
(fill (rand-nth colors))))
(def colors
["White"
"Silver"
"Gray"
"Black"
"Red"
"Maroon"
"Yellow"
"Olive"
"Lime"
"Green"
"Aqua"
"Teal"
"Blue"
"Navy"
"Fuchsia"
"Purple"])
(defn draw! []
(clear!)
(for-each [r (integers :from 800 :to 0 :step -20)]
(circle
(position "50%" "50%")
(radius r)
(stroke-width 3)
(stroke "black")
(fill (rand-nth colors))))
(js/setTimeout draw! 200))
(draw!)
(clear!)
(def colors
["White"
"Silver"
"Gray"
"Black"
"Red"
"Maroon"
"Yellow"
"Olive"
"Lime"
"Green"
"Aqua"
"Teal"
"Blue"
"Navy"
"Fuchsia"
"Purple"])
(for-each [x (integers :from 0 :to 1000 :step 60)
y (integers :from 0 :to 1000 :step 60)]
(circle
(position x y)
(radius 30)
(stroke-width 3)
(stroke "black")
(fill (rand-nth colors))))
(clear!)
(def colors
["White"
"Silver"
"Gray"
"Black"
"Red"
"Maroon"
"Yellow"
"Olive"
"Lime"
"Green"
"Aqua"
"Teal"
"Blue"
"Navy"
"Fuchsia"
"Purple"])
(for-each [i (integers :from 10 :to 0 :step -1)]
(rectangle
(position (- 150 (* 10 i)) (- 390 (* 10 i)))
(fill (rand-nth colors))
(width (+ 410 (* 20 i)))
(stroke-width 2)
(rounded-corners 5)
(height (+ 80 (* 20 i)))))
(text "Hello, World!"
(position 360 425)
(font-size 70)
(font-family "Helvetica Neue")
(font-weight 100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment