How to pass a parameter only if certain condition is true?

I have a script that’s getting a bit messy:

float value = MGS.Math.PercentOf(current_health, 0, max_health, min_color, max_color);
if (red && !blue && !green)
	MGS.Color.ChangeColor(SpriteR, (int)value, 255, 255, 255);
else if (!red && blue && !green)
	MGS.Color.ChangeColor(SpriteR, 255, (int)value, 225, 255);
else if (!red && !blue && green)
	MGS.Color.ChangeColor(SpriteR, 255, 225, (int)value, 255);
else if (red && blue && !green)
	MGS.Color.ChangeColor(SpriteR, (int)value, (int)value, 225, 255);
if (red && !blue && green)
	MGS.Color.ChangeColor(SpriteR, (int)value, 255, (int)value, 255);
if (!red && blue && green)
	MGS.Color.ChangeColor(SpriteR, 255, (int)value, (int)value, 255);
if (red && blue && green)
	MGS.Color.ChangeColor(SpriteR, (int)value, (int)value, (int)value, 255);
else
	return;

To avoid this mess, I wanted to do something like this:

float value = MGS.Math.PercentOf(current_health, 0, max_health, min_color, max_color);
MGS.Color.ChangeColor(SpriteR, if (red) { (int)value } else { 255 }, if (blue) { (int)value } else { 255 }, if (green) { (int)value } else { 255 }, 255);

Is something like this even possible? Thanks in advance.

Determine the values beforehand using the ? operator, like this:

float value = MGS.Math.PercentOf(current_health, 0, max_health, min_color, max_color);
int r = red ? (int)value : 255;
int g = green ? (int)value : 255;
int b = blue ? (int)value : 255;
MGS.Color.ChangeColor(SpriteR, r,g,b,255);