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

CSS rgba() colors are incorrectly parsed #2029

Closed
EatChangmyeong opened this issue Apr 25, 2022 · 0 comments · Fixed by #2071
Closed

CSS rgba() colors are incorrectly parsed #2029

EatChangmyeong opened this issue Apr 25, 2022 · 0 comments · Fixed by #2071
Assignees
Labels

Comments

@EatChangmyeong
Copy link

Issue or Feature

Colors in three-argument rgba(R, G, B) notation are parsed as fully transparent colors, instead of being fully opaque. This issue does not show up in four-argument rgba(R, G, B, A) or rgb(R, G, B) without a.

Steps to Reproduce

var Canvas = require('canvas');
var canvas = Canvas.createCanvas(200, 200);
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(255, 255, 255)';
console.log(ctx.fillStyle); // rgba(255, 255, 255, 0.00)

Your Environment

  • Version of node-canvas (output of npm list canvas or yarn list canvas): 2.9.1
  • Environment (e.g. node 4.2.0 on Mac OS X 10.8): node 16.14.2
@zbjornson zbjornson added the Bug label Jul 7, 2022
@zbjornson zbjornson self-assigned this Jul 7, 2022
zbjornson added a commit that referenced this issue Jul 7, 2022
`rgb()` and `rgba()` are supposed to have identical grammar and behavior: https://www.w3.org/TR/css-color-4/#rgb-functions.

Fixes #2029
zbjornson added a commit that referenced this issue Jul 7, 2022
`rgb()` and `rgba()` are supposed to have identical grammar and behavior: https://www.w3.org/TR/css-color-4/#rgb-functions.

Fixes #2029
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants