export const COLORS = ["black","brown","red","orange","yellow","green","blue","violet","grey","white"];
export const decodedResistorValue = ([c1, c2, c3]) => {
let val = (COLORS.indexOf(c1) * 10 + COLORS.indexOf(c2)) * (10 ** COLORS.indexOf(c3));
let unit = 'ohms';
if (val >= 1000) {
val /= 1000;
unit = 'kiloohms';
}
return `${val} ${unit}`;
};