Created
March 21, 2017 17:51
-
-
Save cormullion/33da9478089fd4ff6826c5eddef96b66 to your computer and use it in GitHub Desktop.
JuliaData logo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Luxor | |
| function drawcell(centerpos, width, height, colornumber; hollow=false) | |
| darker_purple = (0.584, 0.345, 0.698) | |
| lighter_purple = (0.667, 0.475, 0.757) | |
| darker_green = (0.22, 0.596, 0.149) | |
| lighter_green = (0.376, 0.678, 0.318) | |
| darker_red = (0.796, 0.235, 0.2) | |
| lighter_red = (0.835, 0.388, 0.361) | |
| color_sequence = [(darker_red, lighter_red), | |
| (darker_green, lighter_green), | |
| (darker_purple, lighter_purple)] | |
| sethue(color_sequence[colornumber][1]...) | |
| squircle(centerpos, width - 2, height - 2, :fill) | |
| hollow ? sethue("white") : sethue(color_sequence[colornumber][2]...) | |
| squircle(centerpos, width - 10, height - 10, :fill) | |
| end | |
| function drawtable(n, centerp, tableside; ncells=5) | |
| gsave() | |
| translate(centerp) | |
| datatable = Tiler(tableside, tableside, ncells, ncells) | |
| for (pos, p) in datatable | |
| if datatable.currentrow == 1 && datatable.currentcol == 1 | |
| # | |
| elseif datatable.currentrow == 1 || datatable.currentcol == 1 | |
| drawcell(pos, datatable.tilewidth/2 - 3, datatable.tileheight/2 - 3, n, hollow=true) | |
| else | |
| drawcell(pos, datatable.tilewidth/2, datatable.tileheight/2, n) | |
| end | |
| end | |
| grestore() | |
| end | |
| function drawtables(center::Point, radius, tableside, ncells=5) | |
| centerpoints = ngon(center, radius, 3, pi/6, vertices=true) | |
| [drawtable(n, centerpoints[n], tableside, ncells=ncells) for n in 1:3] | |
| end | |
| function drawlogo3(fname) | |
| Drawing(500, 500, fname) | |
| background("white") # uncomment for transparent background | |
| origin() | |
| translate(0, 30) # optical correction | |
| drawtables(O, 150, 225, 6) | |
| finish() | |
| preview() | |
| end | |
| drawlogo3("/tmp/juliadata.png") |
cormullion
commented
Mar 21, 2017
Author

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment