Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/env python3
- print ("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>")
- print ("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">")
- print ("<svg width=\"17.6mm\" height=\"17.6mm\" viewBox=\"0 0 17.6mm 17.6mm\" xmlns=\"http://www.w3.org/2000/svg\">")
- for y in range (16):
- for x in range (16):
- value = 255 - y * 16 - x
- fill = f"#{value:02x}{value:02x}{value:02x}"
- print (f"<rect x=\"{x * 1.1}mm\" y=\"{y * 1.1}mm\" width=\"1.1mm\" height=\"1.1mm\" fill=\"{fill}\"/>")
- print ("</svg>")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement