Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Generate an illustration of resistor color codes from a specified resistance
| ResourceFunction["ResistorColorCode"][resistance,"ColorList"] generates a list of resistor color codes used to represent the specified resistance. | |
| ResourceFunction["ResistorColorCode"][resistance,"Graphics"] generates a resistor color code illustration used to represent the specified resistance found in analog electronics. | |
| ResourceFunction["ResistorColorCode"][<|"Resistance"→resistance,"Tolerance"→tolerance|>,prop] uses the specified resistance and tolerance. | 
Generate a list of colors corresponding to a resistor color code for a given resistance:
| In[1]:= | ![ResourceFunction["ResistorColorCode"][
 Quantity[1.34, "Ohms"], "ColorList"]](https://www.wolframcloud.com/obj/resourcesystem/images/d18/d18d3423-7441-448d-9e20-a84f3876a85d/06ec33e8abf48ec7.png) | 
| Out[1]= |  | 
Display a graphical representation of the resistor:
| In[2]:= | ![ResourceFunction["ResistorColorCode"][
 Quantity[1.34, "Ohms"], "Graphics"]](https://www.wolframcloud.com/obj/resourcesystem/images/d18/d18d3423-7441-448d-9e20-a84f3876a85d/0f3b81dfad165617.png) | 
| Out[2]= |  | 
Generate a pair of images when there are two equivalent color code representations:
| In[3]:= | ![ResourceFunction["ResistorColorCode"][
 Quantity[5000, "Ohms"], "Graphics"]](https://www.wolframcloud.com/obj/resourcesystem/images/d18/d18d3423-7441-448d-9e20-a84f3876a85d/54fccc7482e2927b.png) | 
| Out[3]= |  | 
Generate a pair of color lists instead of graphics:
| In[4]:= | ![ResourceFunction["ResistorColorCode"][
 Quantity[5000, "Ohms"], "ColorList"]](https://www.wolframcloud.com/obj/resourcesystem/images/d18/d18d3423-7441-448d-9e20-a84f3876a85d/41fec550552e3199.png) | 
| Out[4]= |  | 
The final stripe represents the tolerance value:
| In[5]:= | ![ResourceFunction[
 "ResistorColorCode"][<|"Resistance" -> Quantity[5000, "Ohms"], "Tolerance" -> Quantity[1, "Percent"]|>, "Graphics"]](https://www.wolframcloud.com/obj/resourcesystem/images/d18/d18d3423-7441-448d-9e20-a84f3876a85d/0a4a5008b65bab81.png) | 
| Out[5]= |  | 
| In[6]:= | ![ResourceFunction[
 "ResistorColorCode"][<|"Resistance" -> Quantity[11600, "Ohms"], "Tolerance" -> Quantity[10, "Percent"]|>]](https://www.wolframcloud.com/obj/resourcesystem/images/d18/d18d3423-7441-448d-9e20-a84f3876a85d/12bf5fb3effce75c.png) | 
| Out[6]= |  | 
Generate color lists including an entry for the tolerance:
| In[7]:= | ![ResourceFunction[
 "ResistorColorCode"][<|"Resistance" -> Quantity[5000, "Ohms"], "Tolerance" -> Quantity[1, "Percent"]|>, "ColorList"]](https://www.wolframcloud.com/obj/resourcesystem/images/d18/d18d3423-7441-448d-9e20-a84f3876a85d/65ee0651d671b574.png) | 
| Out[7]= |  | 
When "Graphics" is specified, ResistorColorCode accepts the same options as Graphics:
| In[8]:= | ![ResourceFunction["ResistorColorCode"][
 Quantity[1.34, "Ohms"], "Graphics", ImageSize -> 400, Background -> Gray]](https://www.wolframcloud.com/obj/resourcesystem/images/d18/d18d3423-7441-448d-9e20-a84f3876a85d/695257670554ccc6.png) | 
| Out[8]= |  | 
ResistorColorCode can accept the results of the resource function FromResistorColorCode as an argument:
| In[9]:= | ![ResourceFunction["ResistorColorCode"][
 ResourceFunction["FromResistorColorCode"][{Red, Red, Blue}], "Graphics"]](https://www.wolframcloud.com/obj/resourcesystem/images/d18/d18d3423-7441-448d-9e20-a84f3876a85d/1f7ac57aa5818cd0.png) | 
| Out[9]= |  | 
This work is licensed under a Creative Commons Attribution 4.0 International License