Get Markdown embeddable images from hex color tags.
Example output:
# regex for matching hex colors \#[0-9a-f]{6} | |
url = 'https://singlecolorimage.com/get/' | |
end = '/200x70' | |
colors = ['#80a8ff', | |
'#01ff6b', | |
'#ff8000', | |
'#000000', | |
'#00ffff', | |
'#ddff00', | |
'#808000', | |
'#80ff8d', | |
'#afff80', | |
'#91ff00', | |
'#ffae00', | |
'#c0c0c0', | |
'#ff00ff', | |
'#c080ff', | |
'#9580ff', | |
'#ffaaba', | |
'#800080', | |
'#500080', | |
'#004080', | |
'#800057', | |
'#0000ff', | |
'#8086ff', | |
'#ffc280', | |
'#ffa080', | |
'#ff0000', | |
'#ff9d9d'] | |
colors = list(map(lambda x: x[1:], colors)) | |
urls = [url + color + end for color in colors] | |
markdown = ['![' + color + ']' + '('+img_url+')' for color, img_url in zip(list(colors), urls)] | |
for line in markdown: | |
print(line) |