Controlling color (and brightness) of RGB LED strip using one potentiometer
Figure 1. RGB mixing control signals.

To do what you require you will need to crossfade between red, green and blue. 


At zero potentiometer setting red is fully on. Green and blue are off.
As you adjust the potentiometer over the first 1/6th the green fades up to 100%.
On the next 1/6th the red fades out until you only have green.
The pattern repeats for green to blue transition and finally for blue to red ending at the start point of full red.


Note that you can't get white light with this setup as you would require all lights on.

This would be a little complex to do with an analog circuit but easy enough with a micro. Assuming the micro analog in read or encoder counting from 0 to 100 and the analog outputs put out 0 to 100 the code would look something similar to the pseudo-code below

// RGB LED cross-fade control pseudo-code.
// Note 1/6th of 100 = 16.666.
if(Ain &lt;= 16.6){                     // 0 to 60°
  R = 100;                           // Red on.
  G = Ain * 6;                       // Green fading up.
  B = 0;                             // Blue off.
}
if((Ain &gt; 16.6) &amp;&amp; (Ain &lt;= 33.3){    // 60° to 120°
  R = 100 - (Ain - 16.6) * 6;        // Red fading down.
  G = 100;                           // Green on.
  B = 0;                             // Blue off.
}
if((Ain &gt; 33.3) &amp;&amp; (Ain &lt;= 50){      // 120° to 180°
  R = 0;                             // Red off.
  G = 100;                           // Green on.
  B = (Ain - 33.3) * 6;              // Blue fading up.
}
if((Ain &gt; 50) &amp;&amp; (Ain &lt;= 62.3){      // 180° to 240°
  R = 0;                             // Red off.
  G = 100 - (Ain - 50) * 6;          // Green fading down.
  B = 100;                           // Blue on.
}
if((Ain &gt; 66.6) &amp;&amp; (Ain &lt;= 83.3){    // 240° to 300°
  R = (Ain - 66.6) * 6;              // Red fading up.
  G = 0;                             // Green off.
  B = 100;                           // Blue on.
}
if((Ain &gt; 83.3) &amp;&amp; (Ain &lt;= 100){     // 300° to 360°
  R = 100;                           // Red on.
  G = 0;                             // Green off.
  B = 100 - (Ain - 86.6) * 6;        // Red fading down.
}



  Ideally it would be a dual potentiometer to control brightness as well as color.


If you mean a 2-gang potentiometer (both on the same shaft) then you have a problem. If the brightness changes from min to max as you rotate the pot then you will have lamps off at the zero end and fully on at the 100% end getting brighter as you sweep through the spectrum. In our example above you would never have bright yellow.

Very simplified schematic







simulate this circuit &ndash; Schematic created using CircuitLab

Figure 2. A simplified schematic diagram of a micro controller for this system.

Improve your question and we can add more details to the answer.

Using a rotary encoder rather than a potentiometer

There are two problems with the potentiometer approach:


There are end-stops so when you reach the end of travel you can only go in reverse through the sequence you have just done.
It doesn't solve the brightness part of your question.


A good solution would be to use a rotary encoder with push switch.



Figure 3. A simple mechanical rotary encoder with push-to-make switch.

These work as a "quadrature encoder" giving out to pulse trains (as you rotate the knob) which are 90° out of phase. (90° = quarter of a turn, hence quadrature.) 







simulate this circuit

Figure 4. 2-bit rotary encoder waveforms.

The program logic is very simple. 


Track the current state of 'A'. If the state changes to 'high' then:
Look at input 'B'. If 'B' is low then count up. If 'B' is high then count down.
Add in some logic to roll the counter over as follows:


Pseudo code:

if (count &gt; 100) count = 0;
if (count &lt; 0) count = 100;  // or your value for maximum count.
// Choose a maximum count value to give the resolution / speed 
// you require on the encoder. If it's an even multiple of 6 all
// your code compares become integers and avoid the 16.667 multiples
// in the earlier pseudo-code. 


The encoder has a third contact that makes when the button is pressed. With this you can now do much more sophisticated control. E.g., rotating knob un-pressed changes colour as discussed above. Rotating knob while pressed
changes brightness.







simulate this circuit

Figure 5. Encoder version schematic. Note that the micro's internal pull-up resistors would have to be enabled and some debounce logic required in the code to prevent spurious counts due to contact bounce.



Figure 6. Innards of the rotary encoder portion of an encoder / pushbutton. Source: an interesting disassembly article on Efton.sk.

Note the clever arrangement of the contacts in Figure 6. The rotor has three connected contacts 120° apart. One is always in contact with the common strip at the bottom of the photo. The other two will contact the "teeth" on the 'A' and 'B' segments in quadrature. Note the slightly wider black gap in the 12 o'clock position which offsets the patterns by the required 1/4 of a step.

Even brightness control


  You don't need the plateaus particularly if you want an even brightness (100% red + 100% green will be bright compared to red and green separately). @IanBland.




Figure 7. Alternative cross-fade strategy for even brightness. Code would have to be modified to suit.