i try this, getting the red, blue, and green and + with the new color's red, green, and blue. then i mod 256 to prevent bounding.
it;s color is not like the mix color that i want.
for example , black = 255. then i add with some bright color, say its value is 100. it becomes 100 instead of the combination of both color (because 255 + 100 = 355%256 = 100)
> i try this, getting the red, blue, and green and +
> with the new color's red, green, and blue. then i mod
> 256 to prevent bounding.
You should average the two values. So if you had two red values, one is 255 and the other is 100, then:
255 + 100
= 177 (<-- new red value)
2
You can also draw with a translucent color. If the background color is yellow and you want to mix it with red, then create the red color like this.
Color translucentRed = new Color(255, 0, 0, 128);
http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Color.html#Color(int,%20int,%20int,%20int)