color maps

This commit is contained in:
Will Charczuk 2017-04-14 17:43:52 -07:00
parent 4f15ced303
commit fdb1b191b2
11 changed files with 577 additions and 170 deletions

View file

@ -45,6 +45,9 @@ type Style struct {
DotColor drawing.Color
DotWidth float64
DotWidthProvider SizeProvider
DotColorProvider ColorProvider
FillColor drawing.Color
FontSize float64
@ -355,6 +358,9 @@ func (s Style) InheritFrom(defaults Style) (final Style) {
final.DotColor = s.GetDotColor(defaults.DotColor)
final.DotWidth = s.GetDotWidth(defaults.DotWidth)
final.DotWidthProvider = s.DotWidthProvider
final.DotColorProvider = s.DotColorProvider
final.FillColor = s.GetFillColor(defaults.FillColor)
final.FontColor = s.GetFontColor(defaults.FontColor)
final.FontSize = s.GetFontSize(defaults.FontSize)
@ -426,7 +432,7 @@ func (s Style) ShouldDrawStroke() bool {
// ShouldDrawDot tells drawing functions if they should draw the dot.
func (s Style) ShouldDrawDot() bool {
return !s.DotColor.IsZero() && s.DotWidth > 0
return (!s.DotColor.IsZero() && s.DotWidth > 0) || s.DotColorProvider != nil || s.DotWidthProvider != nil
}
// ShouldDrawFill tells drawing functions if they should draw the stroke.