# the current julia logo

"""
Draw the logo:

    julialogo(colored=true, masking=false)

Just create paths for the logo but don't apply :

    julialogo(false, true)

Typical usage:

```
using Luxor, Colors
# find this file, eg:
include("~/.julia/v0.5/Luxor/test/julia-logo.jl"))
Drawing(1000, 1000, "/tmp/heart-julia.pdf")
origin()
background("white")
julialogo()
finish()
preview()
```

"""

function julialogo(colored=true, masking=false)
    # set colors if colored is true
    # do the fills if masking is false
    colored && setcolor("black")
    move(72.872, 177.311)
    curve(72.872, 184.847, 72.024, 190.932, 70.329, 195.567)
    curve( 68.633, 200.202, 66.222, 203.8, 63.094, 206.362)
    curve( 59.967, 208.925, 56.217, 210.639, 51.846, 211.506)
    curve( 47.476, 212.373, 42.615, 212.806, 37.264, 212.806)
    curve( 30.029, 212.806, 24.49, 211.675, 20.647, 209.414)
    curve( 16.803, 207.154, 14.881, 204.441, 14.881, 201.275)
    curve( 14.881, 198.638, 15.955, 196.415, 18.103, 194.606)
    curve( 20.251, 192.797, 23.134, 191.893, 26.751, 191.893)
    curve( 29.464, 191.893, 31.631, 192.628, 33.251, 194.097)
    curve( 34.872, 195.567, 36.209, 197.018, 37.264, 198.449)
    curve( 38.47, 200.032, 39.487, 201.087, 40.316, 201.615)
    curve( 41.145, 202.142, 41.899, 202.406, 42.577, 202.406)
    curve( 44.009, 202.406, 45.102, 201.558, 45.855, 199.862)
    curve( 46.609, 198.167, 46.985, 194.87, 46.985, 189.971)
    line(46.985, 97.051)
    line(72.872, 89.929)
    line(72.872, 177.311)
    masking ? newsubpath() : fill()

    move(109.739, 92.416)
    line(109.739, 152.215)
    curve( 109.739, 153.874, 110.06, 155.437, 110.7, 156.907)
    curve( 111.341, 158.376, 112.226, 159.639, 113.357, 160.694)
    curve( 114.487, 161.749, 115.806, 162.596, 117.313, 163.237)
    curve( 118.821, 163.878, 120.441, 164.198, 122.174, 164.198)
    curve( 124.134, 164.198, 126.36, 163.101, 129.069, 161.202)
    curve( 133.363, 158.194, 135.965, 156.127, 135.965, 153.685)
    curve( 135.965, 153.099, 135.965, 92.416, 135.965, 92.416)
    line(161.738, 92.416)
    line(161.738, 177.311)
    line(135.965, 177.311)
    line(135.965, 169.398)
    curve( 132.574, 172.262, 128.956, 174.56, 125.113, 176.293)
    curve( 121.27, 178.027, 117.539, 178.893, 113.922, 178.893)
    curve( 109.702, 178.893, 105.783, 178.196, 102.165, 176.802)
    curve( 98.548, 175.408, 95.383, 173.505, 92.67, 171.093)
    curve( 89.957, 168.682, 87.828, 165.856, 86.283, 162.615)
    curve( 84.739, 159.375, 83.966, 155.908, 83.966, 152.215)
    line(83.966, 92.416)
    line(109.739, 92.416)
    masking ? newsubpath() : fill()

    move(197.881, 177.311)
    line(172.221, 177.311)
    line(172.221, 58.278)
    line(197.881, 51.156)
    line(197.881, 177.311)
    masking ? newsubpath() : fill()

    move(208.603, 97.051)
    line(234.376, 89.929)
    line(234.376, 177.311)
    line(208.603, 177.311)
    line(208.603, 97.051)
    masking ? newsubpath() : fill()

    move(288.225, 133.451)
    curve(285.738, 134.506, 283.232, 135.731, 280.707, 137.124)
    curve(278.183, 138.519, 275.884, 140.045, 273.812, 141.703)
    curve(271.74, 143.361, 270.062, 145.132, 268.782, 147.015)
    curve(267.501, 148.9, 266.86, 150.859, 266.86, 152.894)
    curve(266.86, 154.476, 267.067, 156.002, 267.481, 157.472)
    curve(267.896, 158.941, 268.48, 160.204, 269.234, 161.259)
    curve(269.988, 162.314, 270.816, 163.162, 271.721, 163.802)
    curve(272.625, 164.443, 273.605, 164.763, 274.66, 164.763)
    curve(276.77, 164.763, 278.899, 164.123, 281.047, 162.841)
    curve(283.194, 161.56, 285.587, 159.94, 288.225, 157.981)
    line(288.225, 133.451)
    newsubpath()
    move(314.111, 177.311)
    line(288.225, 177.311)
    line(288.225, 170.528)
    curve(286.792, 171.734, 285.399, 172.846, 284.042, 173.863)
    curve(282.686, 174.88, 281.16, 175.766, 279.464, 176.519)
    curve(277.768, 177.273, 275.866, 177.857, 273.755, 178.272)
    curve(271.645, 178.686, 269.158, 178.893, 266.295, 178.893)
    curve(262.375, 178.893, 258.853, 178.328, 255.725, 177.198)
    curve(252.597, 176.067, 249.941, 174.522, 247.756, 172.563)
    curve(245.571, 170.604, 243.893, 168.287, 242.725, 165.611)
    curve(241.558, 162.936, 240.973, 160.015, 240.973, 156.85)
    curve(240.973, 153.61, 241.595, 150.671, 242.838, 148.033)
    curve(244.082, 145.396, 245.778, 143.022, 247.925, 140.911)
    curve(250.073, 138.801, 252.579, 136.917, 255.443, 135.259)
    curve(258.306, 133.601, 261.377, 132.075, 264.655, 130.681)
    curve(267.934, 129.287, 271.344, 128.006, 274.886, 126.838)
    curve(278.427, 125.67, 281.932, 124.558, 285.399, 123.503)
    line(288.225, 122.825)
    line(288.225, 114.459)
    curve(288.225, 109.034, 287.188, 105.19, 285.116, 102.929)
    curve(283.044, 100.668, 280.274, 99.538, 276.807, 99.538)
    curve(272.738, 99.538, 269.912, 100.518, 268.329, 102.477)
    curve(266.747, 104.436, 265.955, 106.81, 265.955, 109.599)
    curve(265.955, 111.181, 265.786, 112.726, 265.447, 114.233)
    curve(265.108, 115.741, 264.523, 117.059, 263.695, 118.19)
    curve(262.866, 119.32, 261.679, 120.225, 260.134, 120.903)
    curve(258.589, 121.581, 256.649, 121.92, 254.312, 121.92)
    curve(250.695, 121.92, 247.756, 120.884, 245.495, 118.812)
    curve(243.234, 116.739, 242.104, 114.12, 242.104, 110.955)
    curve(242.104, 108.016, 243.102, 105.284, 245.099, 102.76)
    curve(247.097, 100.235, 249.79, 98.068, 253.182, 96.26)
    curve(256.573, 94.451, 260.492, 93.019, 264.938, 91.964)
    curve(269.384, 90.909, 274.094, 90.382, 279.068, 90.382)
    curve(285.173, 90.382, 290.429, 90.928, 294.838, 92.021)
    curve(299.246, 93.114, 302.883, 94.677, 305.746, 96.712)
    curve(308.609, 98.747, 310.72, 101.196, 312.076, 104.06)
    curve(313.433, 106.923, 314.111, 110.127, 314.111, 113.668)
    line(314.111, 177.311)
    masking ? newsubpath() : fill()

    colored && setcolor(0.835, 0.388, 0.361)
    move(222.772, 84.091)
    curve(213.936, 84.091, 206.772, 76.928, 206.772, 68.091)
    curve(206.772, 59.255, 213.936, 52.091, 222.772, 52.091)
    curve(231.609, 52.091, 238.772, 59.255, 238.772, 68.091)
    curve(238.772, 76.928, 231.609, 84.091, 222.772, 84.091)
    masking ? newsubpath() : fill()

    colored && setcolor(0.796, 0.235, 0.2)
    move(222.772, 50.591)
    curve(232.437, 50.591, 240.272, 58.426, 240.272, 68.091)
    curve(240.272, 77.756, 232.437, 85.591, 222.772, 85.591)
    curve(213.107, 85.591, 205.272, 77.756, 205.272, 68.091)
    curve(205.272, 58.426, 213.107, 50.591, 222.772, 50.591)
    newsubpath()
    move(222.772, 53.591)
    curve(214.764, 53.591, 208.272, 60.083, 208.272, 68.091)
    curve(208.272, 76.099, 214.764, 82.591, 222.772, 82.591)
    curve(230.781, 82.591, 237.272, 76.099, 237.272, 68.091)
    curve(237.272, 60.083, 230.781, 53.591, 222.772, 53.591)
    masking ? newsubpath() : fill()

    colored && setcolor(0.4, 0.51, 0.878)
    move(60.454, 84.091)
    curve(51.618, 84.091, 44.454, 76.928, 44.454, 68.091)
    curve(44.454, 59.255, 51.618, 52.091, 60.454, 52.091)
    curve(69.291, 52.091, 76.454, 59.255, 76.454, 68.091)
    curve(76.454, 76.928, 69.291, 84.091, 60.454, 84.091)

    masking ? newsubpath() : fill()
    colored && setcolor(0.251, 0.388, 0.847)
    move(60.454, 50.591)
    curve(70.119, 50.591, 77.954, 58.426, 77.954, 68.091)
    curve(77.954, 77.756, 70.119, 85.591, 60.454, 85.591)
    curve(50.789, 85.591, 42.954, 77.756, 42.954, 68.091)
    curve(42.954, 58.426, 50.789, 50.591, 60.454, 50.591)
    newsubpath()
    move(60.454, 53.591)
    curve(52.446, 53.591, 45.954, 60.083, 45.954, 68.091)
    curve(45.954, 76.099, 52.446, 82.591, 60.454, 82.591)
    curve(68.462, 82.591, 74.954, 76.099, 74.954, 68.091)
    curve(74.954, 60.083, 68.462, 53.591, 60.454, 53.591)
    masking ? newsubpath() : fill()

    colored && setcolor(0.667, 0.475, 0.757)
    move(264.821, 84.091)
    curve(255.984, 84.091, 248.821, 76.928, 248.821, 68.091)
    curve(248.821, 59.255, 255.984, 52.091, 264.821, 52.091)
    curve(273.658, 52.091, 280.821, 59.255, 280.821, 68.091)
    curve(280.821, 76.928, 273.658, 84.091, 264.821, 84.091)
    masking ? newsubpath() : fill()

    colored && setcolor(0.584, 0.345, 0.698)
    move(264.821, 50.591)
    curve(274.486, 50.591, 282.321, 58.426, 282.321, 68.091)
    curve(282.321, 77.756, 274.486, 85.591, 264.821, 85.591)
    curve(255.156, 85.591, 247.321, 77.756, 247.321, 68.091)
    curve(247.321, 58.426, 255.156, 50.591, 264.821, 50.591)
    newsubpath()
    move(264.821, 53.591)
    curve(256.813, 53.591, 250.321, 60.083, 250.321, 68.091)
    curve(250.321, 76.099, 256.813, 82.591, 264.821, 82.591)
    curve(272.829, 82.591, 279.321, 76.099, 279.321, 68.091)
    curve(279.321, 60.083, 272.829, 53.591, 264.821, 53.591)
    masking ? newsubpath() : fill()

    colored && setcolor(0.376, 0.678, 0.318)
    move(243.799, 47.672)
    curve(234.962, 47.672, 227.799, 40.509, 227.799, 31.672)
    curve(227.799, 22.836, 234.962, 15.672, 243.799, 15.672)
    curve(252.636, 15.672, 259.799, 22.836, 259.799, 31.672)
    curve(259.799, 40.509, 252.636, 47.672, 243.799, 47.672)
    masking ? newsubpath() : fill()

    colored && setcolor(0.22, 0.596, 0.149)
    move(243.799, 14.172)
    curve(253.464, 14.172, 261.299, 22.007, 261.299, 31.672)
    curve(261.299, 41.337, 253.464, 49.172, 243.799, 49.172)
    curve(234.134, 49.172, 226.299, 41.337, 226.299, 31.672)
    curve(226.299, 22.007, 234.134, 14.172, 243.799, 14.172)
    newsubpath()
    move(243.799, 17.172)
    curve(235.791, 17.172, 229.299, 23.664, 229.299, 31.672)
    curve(229.299, 39.681, 235.791, 46.172, 243.799, 46.172)
    curve(251.807, 46.172, 258.299, 39.681, 258.299, 31.672)
    curve(258.299, 23.664, 251.807, 17.172, 243.799, 17.172)
    if ! masking
      fill()
    end
end
