This is probably really easy, but I'm lost on how to "make sure" it is in this range..
So basically we have class Color
and many functions to implement from it.
this function I need is:
Effects: corrects a color value to be within 0-255 inclusive. If value is outside this range, adjusts to either 0 or 255, whichever is closer.
This is what I have so far:
static int correctValue(int value)
{
if(value<0)
value=0;
if(value>255)
value=255;
}
Sorry for such a simple question ;/