Reference for Processing version 1.2. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.
Name | tint() |
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Examples | PImage b; b = loadImage("laDefense.jpg"); image(b, 0, 0); // Tint blue tint(0, 153, 204); image(b, 50, 0); PImage b; b = loadImage("laDefense.jpg"); image(b, 0, 0); // Tint blue and set transparency tint(0, 153, 204, 126); image(b, 50, 0); |
||||||||||||||
Description | Sets the fill value for displaying images. Images can be tinted to specified colors or made transparent by setting the alpha.
To make an image transparent, but not change it's color, use white as the tint color and specify an alpha value. For instance, tint(255, 128) will make an image 50% transparent (unless colorMode() has been used). When using hexadecimal notation to specify a color, use "#" or "0x" before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six digits to specify a color (the way colors are specified in HTML and CSS). When using the hexadecimal notation starting with "0x", the hexadecimal value must be specified with eight characters; the first two characters define the alpha component and the remainder the red, green, and blue components. The value for the parameter "gray" must be less than or equal to the current maximum value as specified by colorMode(). The default maximum value is 255. The tint() method is also used to control the coloring of textures in 3D. |
||||||||||||||
Syntax | tint(gray) tint(gray, alpha) tint(value1, value2, value3) tint(value1, value2, value3, alpha) tint(color) tint(color, alpha) tint(hex) tint(hex, alpha) |
||||||||||||||
Parameters |
|
||||||||||||||
Returns | None | ||||||||||||||
Usage | Web & Application | ||||||||||||||
Related | noTint() image() |