-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
2.0.0
Web browser and version
Firefox
Operating system
MacOS
Steps to reproduce this
Steps:
- Load an image
- Use WebGL mode
- Apply a tint with alpha, e.g.
tint(255, 50)
- Draw the image
The image's colours get blown out. e.g. with no tint:
With tint(255, 50)
:
Snippet:
let img
async function setup() {
createCanvas(400, 400, WEBGL)
img = await loadImage('https://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Brown_paper_bag_texture.jpg/960px-Brown_paper_bag_texture.jpg?20161026200514')
}
function draw() {
background(220)
imageMode(CENTER)
tint(255, 50)
image(img, 0, 0, width, height)
}
Live: https://editor.p5js.org/davepagurek/sketches/Cljuh6uQM