Separation of DotColorProvider and ColorProvider Interfaces (#34)

* fully functioning Viridis

* pure functions
This commit is contained in:
Chris Redford 2017-04-17 16:21:02 -07:00 committed by Will Charczuk
parent e53554fb04
commit b3dc3fef3c
7 changed files with 18 additions and 13 deletions

6
jet.go
View file

@ -3,11 +3,7 @@ package chart
import "github.com/wcharczuk/go-chart/drawing"
// Jet is a color map provider based on matlab's jet color map.
func Jet(xr, yr Range, x, y float64) drawing.Color {
return getJetColour(y, yr.GetMin(), yr.GetMax())
}
func getJetColour(v, vmin, vmax float64) drawing.Color {
func Jet(v, vmin, vmax float64) drawing.Color {
c := drawing.Color{R: 0xff, G: 0xff, B: 0xff, A: 0xff} // white
var dv float64