Android Color (setColor in Paint) Needs Negative Integer?
<p>I'm simply trying to paint/draw to the Canvas in Android. However, when I set the color using hex values or using the setARGB method, it doesn't work. But when I use Color.x (eg, Color.GREEN) it works. Here's the code:</p>

<pre><code>    Bitmap image = Bitmap.createBitmap(bitmapWidth, bitmapHeight, Bitmap.Config.ARGB_8888);
    Canvas canvas = new Canvas(image);
    Paint paintBackground = new Paint();
    int green = Color.argb(0, 0, 255, 0); // 65280 (Won't work)
    green = 0x0000ff00; // 65280 (Won't work)
    paintBackground.setARGB(0, 0, 255, 0);
    green = paintBackground.getColor(); // 65280 (Won't work)
    green = Color.GREEN; // -16711936 (Works!)
    paintBackground.setColor(green);
    green = paintBackground.getColor(); // -16711936
    paintBackground.setStyle(Paint.Style.FILL);
    canvas.drawRect(0, 0, bitmapWidth, bitmapHeight, paintBackground);
</code></pre>

<p>So basically Color.GREEN returns -16711936 - and this WORKS.
However, the hex value is 65280 - and this DOES NOT WORK. That is, it doesn't paint the green rectangle.</p>

<p>I need to use hex values because I need to set the color to <code>0x00ffff00</code> here and then later to a different hex value.</p>

<p>Does Android Color (setColor in Paint) Need a Negative Integer?</p>
