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

Added support for named colors #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

jcward
Copy link
Contributor

@jcward jcward commented Apr 30, 2016

Per: https://www.w3.org/TR/SVG/types.html#ColorKeywords

Also moved color definitions and helpers into SVGColor class

return Std.parseInt ("0x" + hex);
}

public static function parseRGBMatch(rgbMatch:EReg):Int
Copy link
Member

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)

@ashes999
Copy link
Member

Looks pretty good. Your test images look awfully identical to each other :)

@ashes999
Copy link
Member

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) +
Copy link
Member

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.

@ibilon
Copy link
Member

ibilon commented Jun 5, 2016

Besides the two details I commented, looks good.

@ashes999
Copy link
Member

Are you planning to fix this up and merge it @jcward ?

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

Successfully merging this pull request may close these issues.

3 participants