Wolfram Research

Function Repository Resource:

ResistorColorCode

Source Notebook

Generate an illustration of resistor color codes from a specified resistance

Contributed by: Jeff Bryant

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.

Details and Options

Depending on the value provided, ResourceFunction["ResistorColorCode"] may return a pair of illustrations when there are equivalent representations.
ResourceFunction["ResistorColorCode"] takes the same options as Graphics.
Values for tolerance must be one of: 0.05%, .1%, .25%, .5%, 1%, 2%, 5%, 10%.
Since FromResistorColorCode returns a resistance and/or tolerance, this can result in alternate forms for the diagram that do not necessarily match the provided color list. A specified color list may result in a unique resistance and/or tolerance, but this can be represented graphically in multiple ways.

Examples

Basic Examples

Generate a list of colors corresponding to a resistor color code for a given resistance:

In[1]:=
ResourceFunction["ResistorColorCode"][
 Quantity[1.34, "Ohms"], "ColorList"]
Out[1]=

Display a graphical representation of the resistor:

In[2]:=
ResourceFunction["ResistorColorCode"][
 Quantity[1.34, "Ohms"], "Graphics"]
Out[2]=

Generate a pair of images when there are two equivalent color code representations:

In[3]:=
ResourceFunction["ResistorColorCode"][
 Quantity[5000, "Ohms"], "Graphics"]
Out[3]=

Generate a pair of color lists instead of graphics:

In[4]:=
ResourceFunction["ResistorColorCode"][
 Quantity[5000, "Ohms"], "ColorList"]
Out[4]=

The final stripe represents the tolerance value:

In[5]:=
ResourceFunction[
 "ResistorColorCode"][<|"Resistance" -> Quantity[5000, "Ohms"], "Tolerance" -> Quantity[1, "Percent"]|>, "Graphics"]
Out[5]=
In[6]:=
ResourceFunction[
 "ResistorColorCode"][<|"Resistance" -> Quantity[11600, "Ohms"], "Tolerance" -> Quantity[10, "Percent"]|>]
Out[6]=

Generate color lists including an entry for the tolerance:

In[7]:=
ResourceFunction[
 "ResistorColorCode"][<|"Resistance" -> Quantity[5000, "Ohms"], "Tolerance" -> Quantity[1, "Percent"]|>, "ColorList"]
Out[7]=

Options

When "Graphics" is specified, ResistorColorCode accepts the same options as Graphics:

In[8]:=
ResourceFunction["ResistorColorCode"][
 Quantity[1.34, "Ohms"], "Graphics", ImageSize -> 400, Background -> Gray]
Out[8]=

Properties and Relations

ResistorColorCode can accept the results of FromResistorColorCode as an argument:

In[9]:=
ResourceFunction["ResistorColorCode"][
 ResourceFunction["FromResistorColorCode"][{Red, Red, Blue}], "Graphics"]
Out[9]=

Resource History

Source Metadata

Related Resources