Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.9.0 addColorStop with opacity 0 #2111

Closed
ShaMan123 opened this issue Sep 7, 2022 · 4 comments
Closed

v2.9.0 addColorStop with opacity 0 #2111

ShaMan123 opened this issue Sep 7, 2022 · 4 comments
Labels

Comments

@ShaMan123
Copy link

ShaMan123 commented Sep 7, 2022

Issue or Feature

Issue, might be related to #2043

Steps to Reproduce

Add a color stop with opacity 0,
The opacity is ignored and treated as 1

const canvas = createCanvas(200, 200);
const ctx = canvas.getContext("2d");
const gradientFrom = "rgba(53,83,192,0.9)"
const gradientTo = "rgba(58,69,110,0)" // opacity 0
const gradient = ctx.createLinearGradient(0, 0, 0, 400)
gradient.addColorStop(0, gradientFrom)
gradient.addColorStop(1, gradientTo)
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, 200, 200);
// etc.

Edit heuristic-sea-kfk9w0

see output for corresponding opacity
image

Your Environment

  • Version of node-canvas (output of npm list canvas or yarn list canvas): 2.9.0+
  • Environment (e.g. node 4.2.0 on Mac OS X 10.8): node v16.14.2 on Windows 10 64bit
@ShaMan123 ShaMan123 changed the title v2.9.0 v2.9.0 addColorStop with opacity 0 Sep 7, 2022
@ShaMan123
Copy link
Author

Tested on v2.8.0 and it works as expected

@H3r3zy
Copy link
Contributor

H3r3zy commented Sep 7, 2022

Will be fix in 2.10.1 #2110

@zbjornson
Copy link
Collaborator

v2.10.1 is out, thanks for the fix @H3r3zy

@ShaMan123
Copy link
Author

Thanks guys!

@zbjornson zbjornson added the Bug label Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants