Introduction
Obi-Wan Kenobi, Qui-Gon Jinn and Darth Maul are about to fight! However, they've all forgotten to bring their respective lightsabers. Write a program or function which, given the string Jedi
as input, generates an image similar to this*:
and given the string Sith
, generates an image similar to this:
Images specifications
Any of the 3 lightsabers (the white blade including the round edge at the end(2 round edges for the red one) and including the handle) is 900px long (This does not include the color gradient around the blade).
The round edge at the end of the blade is a halfcircle (a discrete approximation of it, obviously) with a diameter equal to the width of the blade.
The blade (i.e. the white part of the lightsaber) is 12px wide.
The green and blue lightsabers are separated by 200 px (from the center line of the green blade to the center line of the blue blade).
The handle for all 3 lightsabers is 180px (1/5 of the total length). Therefore the blade itself including the round edge(s) is 720px long for the blue and green lightsabers and 360px long for the two blades of the red lightsaber.
The handle for the blue and green lightsabers is at the bottom of the lightsaber. The handle for the red lightsaber is horizontaly centered.
The length of the gradient from the edge of the white blade to a completely white color is 1.5 * the width of the blade (e.g. 18px for the linear parts).
The green gradient goes from RGB (0,255,0) to white (255,255,255) (or transparent if it's easier for you to implement). The red gradient goes from (255,0,0) to white, and the blue gradient goes from (0,0,255) to white.
The color of the handle is RGB (128,128,128).
There can be white empty space around the lightsaber(s).
Inputs
Either Sith
or Jedi
as a string. You can take this string from STDIN, as a function argument, command line parameter, or anything similar. You may assume that the input will always be exactly Sith
or Jedi
and nothing else.
Output
You must generate an image file containing the image corresponding to the input string. You are relatively free to choose whatever image format you want, as long as it is a True Color image.
Scoring
This is code-golf, so the shortest answer in bytes wins. May the force be with you.
* The images in this post are not displayed full size.