We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello I was wondering how can I change the opacity of a color object without re writing the color back. Is this a possibility? Like color(255, 255, 255).alpha(100) or something similar?
Just a side question, how can you search for documentation in the Processing API here http://processing.github.io/processing-javadocs/core/? I want to search for Color class but have no luck :(.
Answers
There's no Color class in Processing's API.
color
is the same as Java's primitive typeint
:https://Processing.org/reference/color_datatype.html
When we pass 3 arguments to functions color(), fill() and stroke(), it's assumed it's a 100% opaque color.
If you want to specify another alpha value besides
255
, just pass it as their 4th argument:https://Processing.org/reference/color_.html
Is there a way so that I can change alpha without re inputting the argument 1 to argument 3?
Works great thanks!