Need to make sure value is within 0-255
<p>This is probably really easy, but I'm lost on how to "make sure" it is in this range..</p>

<p>So basically we have <code>class Color</code> and many functions to implement from it.</p>

<p>this function I need is:</p>

<p>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.</p>

<p>This is what I have so far:</p>

<pre><code>static int correctValue(int value)
{
    if(value&lt;0)
        value=0;
    if(value&gt;255)
        value=255;
}
</code></pre>

<p>Sorry for such a simple question ;/</p>
