Logical boolean operators

Hi arduinos, I wrote a little piece of code that should increment values until they all reach their target value, but the function stops as soon as one value reaches its target. Shouldn't the WHILE loop stop only when all three values are equal to their respective targets because of the AND operators? Thanks

int R = 0;   //actual targets
int G = 0;
int B = 0;

int targetR = 10;  //target values 
int targetG = 20;
int targetB = 30;

void setup() {

void loop()  {

  while (targetR != R && targetG != G && targetG != B){

void smooth(){
  if (targetR > R){
  if (targetG > G){
  if (targetB > B){

void debugout(){
  Serial.print("    R ");
  Serial.print("    G ");
  Serial.print("    B ");

You are going to need OR operators for that. Alternatively, you might like to read this better, notice the "not" operator out front and the "finish condition" inside, so it is a "while not finished" loop.

while( ! (targetR == R && targetG == G && targetB == B))

Oh look, you have a typo near the end, you have "targetG != B", that isn't going to be good either.

Oh :-[ yeah... got mixed up with the double negative stuff. I like the clarity of your arlternative! :) Thanks