Kata > ResistorColorCode

IEC 60062:2016 defines a standard colour code for showing the rating of resistors.

The code comprises up to five coloured bands.

Up to three bands can be used to denote the significant figures.

The next band is the multiplier for these significant figures.

The final band is for tolerance.

Black denotes 0 as a significant figure or 100 as a multiplier.

Brown denotes 1 as a significant figure, 101 as a multiplier, or ± 1% as a tolerance.

Red denotes 2 as a significant figure, 102 as a multiplier, or ± 2% as a tolerance.

Orange denotes 3 as a significant figure, 103 as a multiplier, or ± 0.05% as a tolerance.

Yellow denotes 4 as a significant figure, 104 as a multiplier, or ± 0.02% as a tolerance.

Green denotes 5 as a significant figure, 105 as a multiplier, or ± 0.5% as a tolerance.

Blue denotes 6 as a significant figure, 106 as a multiplier, or ± 0.25% as a tolerance.

Violet denotes 7 as a significant figure, 107 as a multiplier, or ± 0.5% as a tolerance.

Grey denotes 8 as a significant figure, 108 as a multiplier, or ± 0.1% as a tolerance.

White denotes 9 as a significant figure or 109 as a multiplier.

Gold denotes 10-1 as a multiplier or ± 5% as a tolerance.

Silver denotes 10-2 as a multiplier or ± 10% as a tolerance.

Pink denotes 10-3 as a multiplier.

If no band is present for tolerance then it is ± 20%.

Express the minimum and maximum rating for a resistor based on the colour bands.