-
Notifications
You must be signed in to change notification settings - Fork 30
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
Added support for named colors #40
base: master
Are you sure you want to change the base?
Conversation
return Std.parseInt ("0x" + hex); | ||
} | ||
|
||
public static function parseRGBMatch(rgbMatch:EReg):Int |
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.
What do you think about adding unit tests for these two new functions? (This one and parseHex
)
Looks pretty good. Your test images look awfully identical to each other :) |
Please review @ibilon |
// Support 3-character hex color shorthand | ||
// e.g. #RGB -> #RRGGBB | ||
if (hex.length == 3) { | ||
hex = hex.substr(0,1) + hex.substr(0,1) + |
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.
Better to make variables than calling substr twice.
Besides the two details I commented, looks good. |
Are you planning to fix this up and merge it @jcward ? |
Per: https://www.w3.org/TR/SVG/types.html#ColorKeywords
Also moved color definitions and helpers into SVGColor class