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

Should null be promoted to a Color? #1136

Closed
pixelzoom opened this issue Jan 6, 2021 · 2 comments
Closed

Should null be promoted to a Color? #1136

pixelzoom opened this issue Jan 6, 2021 · 2 comments
Assignees

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Jan 6, 2021

Related to #1135.

I ran in to this inconsistency while working on bamboo.

Color.toColor( null ) and new Color( null ) both fail an assertion in Color set.
PaintDef treats null as Color.TRANSPARENT.

@jonathanolson
Copy link
Contributor

Consistency of treating null as transparent seems beneficial. I've added the support to new Color( null ) and Color.toColor( null ) above.

pixelzoom added a commit that referenced this issue Jan 6, 2021
@pixelzoom
Copy link
Contributor Author

Looks good, expect this type expression is incorrect:

@param {String|Color|null} colorSpec

It should be string, fixed in the above commit.

Closing.

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

No branches or pull requests

2 participants