if (cD.curRed == 0xff && cD.curGreen < 0xff && cD.curBlue == 0x00) { cD.curGreen += rate; } else if (cD.curRed > 0x00 && cD.curGreen == 0xff && cD.curBlue < 0xff) { cD.curRed -= rate; } else if (cD.curRed == 0x00 && cD.curGreen == 0xff && cD.curBlue < 0xff) { cD.curBlue += rate; } else if (cD.curRed == 0x00 && cD.curGreen > 0x00 && cD.curBlue == 0xff) { cD.curGreen -= rate; } else if (cD.curRed < 0xff && cD.curGreen == 0x00 && cD.curBlue == 0xff) { cD.curRed += rate; } else if (cD.curRed == 0xff && cD.curGreen == 0x00 && cD.curBlue > 0x00) { cD.curBlue -= rate; }