Skip to content

Added support for named colors#40

Open
jcward wants to merge 2 commits intoopenfl:masterfrom
jcward:color_names
Open

Added support for named colors#40
jcward wants to merge 2 commits intoopenfl:masterfrom
jcward:color_names

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