qrm2
qrm2 copied to clipboard
resistor/inductor/cap colour code command
Describe the solution you'd like give the command either colour bands or a value and have it return the value or colour bands
Additional context suggest different commands for R/L/C but they could be based on the same function
if we would like, it is easy to generate an image with something like this:
from PIL import Image
def genimage():
im = Image.new(mode="RGB", size=(300, 100), color=(0xd2, 0xb4, 0x8c))
im.paste((0xff, 0, 0), (25, 0, 50, 100))
im.paste((0xff, 0, 0xff), (75, 0, 100, 100))
im.paste((0xff, 0xff, 0), (125, 0, 150, 100))
im.paste((0xff, 0xff, 0x88), (175, 0, 200, 100))
im = im.convert("P", palette=Image.ADAPTIVE, colors=5)
im.save("res.png", optimize=1)
To get something like this:
