-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
De-duplicate, fix, and improve color parsing
There was a very similar color parsing implementation in `color.go` and `chartdraw/drawing/color.go`. After benchmarking it was found that `color.go` was faster, but also incorrectly handled the alpha channel. This commit updates the implementation in `chartdraw/drawing/color.go` to use this simpler and more flexible regex pattern. Allowing both rgb and rgba formats to be parsed by `ColorFromRGBA` in a more performant way. With this change the implementation in `color.go` was removed to instead defer to the improved `chartdraw/drawing/color.go` implementation. PraseColor has been elevated to the `charts` package so this functionality can be easily found.
- Loading branch information
Showing
6 changed files
with
100 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters