-
Notifications
You must be signed in to change notification settings - Fork 601
fix: made gradients work in sketch mode #2487
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
Conversation
alixander
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a test to d2compiler?
Sure, I was waiting for your review on the implementation part. Will add it in the next commit. |
alixander
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Lastly, could you add a line to next.md?
Sorry, I forgot to update it this time. Will update in next commit |
Before d2 was throwing error while using gradient color values in sketch mode. The error was originating from the following line
d2/d2themes/sketch_overlay.go
Line 27 in 7563319
Basically, It can't parse a element fill value set as
url('#grad-<hash>')Now, as a part of the fix, we are checking fill value against a regex
^url\('#grad-[a-f0-9]{40}'\)$, it it matches, we set the luminance value tonormal, since we don't have access to actual gradient-colors anymore. Else we calculate the luminance value from the color value./fixes #2481