Compare commits
1 commit
main
...
wcharczuk-
Author | SHA1 | Date | |
---|---|---|---|
|
0c62c35a2e |
102 changed files with 426 additions and 965 deletions
14
.circleci/config.yml
Normal file
14
.circleci/config.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
working_directory: /go/src/github.com/wcharczuk/go-chart
|
||||
docker:
|
||||
- image: circleci/golang:1.15
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: new-install
|
||||
command: make new-install
|
||||
- run:
|
||||
name: Continuous Integration
|
||||
command: make
|
33
.github/workflows/ci.yml
vendored
33
.github/workflows/ci.yml
vendored
|
@ -1,33 +0,0 @@
|
|||
name: "Continuous Integration"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths: [ "*.go" ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
paths: [ "*.go" ]
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: "Tests"
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
GOOS: "linux"
|
||||
GOARCH: "amd64"
|
||||
GO111MODULE: "on"
|
||||
CGO_ENABLED: "0"
|
||||
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.21
|
||||
|
||||
- name: Check out go-incr
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Run all tests
|
||||
run: go test ./...
|
1
LICENSE
1
LICENSE
|
@ -1,7 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2016 William Charczuk.
|
||||
Copyright (c) 2024 Zeni Kim.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
21
README.md
21
README.md
|
@ -1,9 +1,8 @@
|
|||
go-chart
|
||||
========
|
||||
[![CircleCI](https://circleci.com/gh/wcharczuk/go-chart.svg?style=svg)](https://circleci.com/gh/wcharczuk/go-chart) [![Go Report Card](https://goreportcard.com/badge/github.com/wcharczuk/go-chart)](https://goreportcard.com/report/github.com/wcharczuk/go-chart)
|
||||
|
||||
This project starts from a full copy from [https://git.smarteching.com/zeni/go-chart](https://git.smarteching.com/zeni/go-chart). 28 Oct 2024.
|
||||
|
||||
-
|
||||
Package `chart` is a very simple golang native charting library that supports timeseries and continuous line charts.
|
||||
|
||||
Master should now be on the v3.x codebase, which overhauls the api significantly. Per usual, see `examples` for more information.
|
||||
|
||||
|
@ -12,7 +11,7 @@ Master should now be on the v3.x codebase, which overhauls the api significantly
|
|||
To install `chart` run the following:
|
||||
|
||||
```bash
|
||||
> go get git.smarteching.com/zeni/go-chart/v2@latest
|
||||
> go get github.com/wcharczuk/go-chart@latest
|
||||
```
|
||||
|
||||
Most of the components are interchangeable so feel free to crib whatever you want.
|
||||
|
@ -21,27 +20,27 @@ Most of the components are interchangeable so feel free to crib whatever you wan
|
|||
|
||||
Spark Lines:
|
||||
|
||||
![](https://git.smarteching.com/zeni/go-chart/raw/branch/main/_images/tvix_ltm.png)
|
||||
![](https://raw.githubusercontent.com/wcharczuk/go-chart/master/_images/tvix_ltm.png)
|
||||
|
||||
Single axis:
|
||||
|
||||
![](https://git.smarteching.com/zeni/go-chart/raw/branch/main/_images/goog_ltm.png)
|
||||
![](https://raw.githubusercontent.com/wcharczuk/go-chart/master/_images/goog_ltm.png)
|
||||
|
||||
Two axis:
|
||||
|
||||
![](https://git.smarteching.com/zeni/go-chart/raw/branch/main/_images/two_axis.png)
|
||||
![](https://raw.githubusercontent.com/wcharczuk/go-chart/master/_images/two_axis.png)
|
||||
|
||||
# Other Chart Types
|
||||
|
||||
Pie Chart:
|
||||
|
||||
![](https://git.smarteching.com/zeni/go-chart/raw/branch/main/_images/pie_chart.png)
|
||||
![](https://raw.githubusercontent.com/wcharczuk/go-chart/master/_images/pie_chart.png)
|
||||
|
||||
The code for this chart can be found in `examples/pie_chart/main.go`.
|
||||
|
||||
Stacked Bar:
|
||||
|
||||
![](https://git.smarteching.com/zeni/go-chart/raw/branch/main/_images/stacked_bar.png)
|
||||
![](https://raw.githubusercontent.com/wcharczuk/go-chart/master/_images/stacked_bar.png)
|
||||
|
||||
The code for this chart can be found in `examples/stacked_bar/main.go`.
|
||||
|
||||
|
@ -49,8 +48,6 @@ The code for this chart can be found in `examples/stacked_bar/main.go`.
|
|||
|
||||
Actual chart configurations and examples can be found in the `./examples/` directory. They are simple CLI programs that write to `output.png` (they are also updated with `go generate`.
|
||||
|
||||
If folder ends in "web", has web servers, so start them with `go run main.go` then access `http://localhost:8080` to see the output.
|
||||
|
||||
# Usage
|
||||
|
||||
Everything starts with the `chart.Chart` object. The bare minimum to draw a chart would be the following:
|
||||
|
@ -61,7 +58,7 @@ import (
|
|||
...
|
||||
"bytes"
|
||||
...
|
||||
"git.smarteching.com/zeni/go-chart/v2" //exposes "chart"
|
||||
"github.com/wcharczuk/go-chart" //exposes "chart"
|
||||
)
|
||||
|
||||
graph := chart.Chart{
|
||||
|
|
|
@ -1,147 +0,0 @@
|
|||
aliceblue #f0f8ff 240,248,255
|
||||
antiquewhite #faebd7 250,235,215
|
||||
aqua #00ffff 0,255,255
|
||||
aquamarine #7fffd4 127,255,212
|
||||
azure #f0ffff 240,255,255
|
||||
beige #f5f5dc 245,245,220
|
||||
bisque #ffe4c4 255,228,196
|
||||
black #000000 0,0,0
|
||||
blanchedalmond #ffebcd 255,235,205
|
||||
blue #0000ff 0,0,255
|
||||
blueviolet #8a2be2 138,43,226
|
||||
brown #a52a2a 165,42,42
|
||||
burlywood #deb887 222,184,135
|
||||
cadetblue #5f9ea0 95,158,160
|
||||
chartreuse #7fff00 127,255,0
|
||||
chocolate #d2691e 210,105,30
|
||||
coral #ff7f50 255,127,80
|
||||
cornflowerblue #6495ed 100,149,237
|
||||
cornsilk #fff8dc 255,248,220
|
||||
crimson #dc143c 220,20,60
|
||||
cyan #00ffff 0,255,255
|
||||
darkblue #00008b 0,0,139
|
||||
darkcyan #008b8b 0,139,139
|
||||
darkgoldenrod #b8860b 184,134,11
|
||||
darkgray #a9a9a9 169,169,169
|
||||
darkgreen #006400 0,100,0
|
||||
darkgrey #a9a9a9 169,169,169
|
||||
darkkhaki #bdb76b 189,183,107
|
||||
darkmagenta #8b008b 139,0,139
|
||||
darkolivegreen #556b2f 85,107,47
|
||||
darkorange #ff8c00 255,140,0
|
||||
darkorchid #9932cc 153,50,204
|
||||
darkred #8b0000 139,0,0
|
||||
darksalmon #e9967a 233,150,122
|
||||
darkseagreen #8fbc8f 143,188,143
|
||||
darkslateblue #483d8b 72,61,139
|
||||
darkslategray #2f4f4f 47,79,79
|
||||
darkslategrey #2f4f4f 47,79,79
|
||||
darkturquoise #00ced1 0,206,209
|
||||
darkviolet #9400d3 148,0,211
|
||||
deeppink #ff1493 255,20,147
|
||||
deepskyblue #00bfff 0,191,255
|
||||
dimgray #696969 105,105,105
|
||||
dimgrey #696969 105,105,105
|
||||
dodgerblue #1e90ff 30,144,255
|
||||
firebrick #b22222 178,34,34
|
||||
floralwhite #fffaf0 255,250,240
|
||||
forestgreen #228b22 34,139,34
|
||||
fuchsia #ff00ff 255,0,255
|
||||
gainsboro #dcdcdc 220,220,220
|
||||
ghostwhite #f8f8ff 248,248,255
|
||||
gold #ffd700 255,215,0
|
||||
goldenrod #daa520 218,165,32
|
||||
gray #808080 128,128,128
|
||||
green #008000 0,128,0
|
||||
greenyellow #adff2f 173,255,47
|
||||
grey #808080 128,128,128
|
||||
honeydew #f0fff0 240,255,240
|
||||
hotpink #ff69b4 255,105,180
|
||||
indianred #cd5c5c 205,92,92
|
||||
indigo #4b0082 75,0,130
|
||||
ivory #fffff0 255,255,240
|
||||
khaki #f0e68c 240,230,140
|
||||
lavender #e6e6fa 230,230,250
|
||||
lavenderblush #fff0f5 255,240,245
|
||||
lawngreen #7cfc00 124,252,0
|
||||
lemonchiffon #fffacd 255,250,205
|
||||
lightblue #add8e6 173,216,230
|
||||
lightcoral #f08080 240,128,128
|
||||
lightcyan #e0ffff 224,255,255
|
||||
lightgoldenrodyellow #fafad2 250,250,210
|
||||
lightgray #d3d3d3 211,211,211
|
||||
lightgreen #90ee90 144,238,144
|
||||
lightgrey #d3d3d3 211,211,211
|
||||
lightpink #ffb6c1 255,182,193
|
||||
lightsalmon #ffa07a 255,160,122
|
||||
lightseagreen #20b2aa 32,178,170
|
||||
lightskyblue #87cefa 135,206,250
|
||||
lightslategray #778899 119,136,153
|
||||
lightslategrey #778899 119,136,153
|
||||
lightsteelblue #b0c4de 176,196,222
|
||||
lightyellow #ffffe0 255,255,224
|
||||
lime #00ff00 0,255,0
|
||||
limegreen #32cd32 50,205,50
|
||||
linen #faf0e6 250,240,230
|
||||
magenta #ff00ff 255,0,255
|
||||
maroon #800000 128,0,0
|
||||
mediumaquamarine #66cdaa 102,205,170
|
||||
mediumblue #0000cd 0,0,205
|
||||
mediumorchid #ba55d3 186,85,211
|
||||
mediumpurple #9370db 147,112,219
|
||||
mediumseagreen #3cb371 60,179,113
|
||||
mediumslateblue #7b68ee 123,104,238
|
||||
mediumspringgreen #00fa9a 0,250,154
|
||||
mediumturquoise #48d1cc 72,209,204
|
||||
mediumvioletred #c71585 199,21,133
|
||||
midnightblue #191970 25,25,112
|
||||
mintcream #f5fffa 245,255,250
|
||||
mistyrose #ffe4e1 255,228,225
|
||||
moccasin #ffe4b5 255,228,181
|
||||
navajowhite #ffdead 255,222,173
|
||||
navy #000080 0,0,128
|
||||
oldlace #fdf5e6 253,245,230
|
||||
olive #808000 128,128,0
|
||||
olivedrab #6b8e23 107,142,35
|
||||
orange #ffa500 255,165,0
|
||||
orangered #ff4500 255,69,0
|
||||
orchid #da70d6 218,112,214
|
||||
palegoldenrod #eee8aa 238,232,170
|
||||
palegreen #98fb98 152,251,152
|
||||
paleturquoise #afeeee 175,238,238
|
||||
palevioletred #db7093 219,112,147
|
||||
papayawhip #ffefd5 255,239,213
|
||||
peachpuff #ffdab9 255,218,185
|
||||
peru #cd853f 205,133,63
|
||||
pink #ffc0cb 255,192,203
|
||||
plum #dda0dd 221,160,221
|
||||
powderblue #b0e0e6 176,224,230
|
||||
purple #800080 128,0,128
|
||||
red #ff0000 255,0,0
|
||||
rosybrown #bc8f8f 188,143,143
|
||||
royalblue #4169e1 65,105,225
|
||||
saddlebrown #8b4513 139,69,19
|
||||
salmon #fa8072 250,128,114
|
||||
sandybrown #f4a460 244,164,96
|
||||
seagreen #2e8b57 46,139,87
|
||||
seashell #fff5ee 255,245,238
|
||||
sienna #a0522d 160,82,45
|
||||
silver #c0c0c0 192,192,192
|
||||
skyblue #87ceeb 135,206,235
|
||||
slateblue #6a5acd 106,90,205
|
||||
slategray #708090 112,128,144
|
||||
slategrey #708090 112,128,144
|
||||
snow #fffafa 255,250,250
|
||||
springgreen #00ff7f 0,255,127
|
||||
steelblue #4682b4 70,130,180
|
||||
tan #d2b48c 210,180,140
|
||||
teal #008080 0,128,128
|
||||
thistle #d8bfd8 216,191,216
|
||||
tomato #ff6347 255,99,71
|
||||
turquoise #40e0d0 64,224,208
|
||||
violet #ee82ee 238,130,238
|
||||
wheat #f5deb3 245,222,179
|
||||
white #ffffff 255,255,255
|
||||
whitesmoke #f5f5f5 245,245,245
|
||||
yellow #ffff00 255,255,0
|
||||
yellowgreen #9acd32 154,205,50
|
|
@ -3,8 +3,8 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -23,7 +23,7 @@ func main() {
|
|||
|
||||
stackedBarChart := chart.StackedBarChart{
|
||||
Title: "Quarterly Sales",
|
||||
TitleStyle: chart.Shown(),
|
||||
TitleStyle: chart.StyleShow(),
|
||||
Background: chart.Style{
|
||||
Padding: chart.Box{
|
||||
Top: 75,
|
||||
|
@ -31,8 +31,8 @@ func main() {
|
|||
},
|
||||
Width: 800,
|
||||
Height: 600,
|
||||
XAxis: chart.Shown(),
|
||||
YAxis: chart.Shown(),
|
||||
XAxis: chart.StyleShow(),
|
||||
YAxis: chart.StyleShow(),
|
||||
BarSpacing: 40,
|
||||
IsHorizontal: true,
|
||||
Bars: []chart.StackedBar{
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
@ -3,8 +3,8 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -23,7 +23,7 @@ func main() {
|
|||
|
||||
stackedBarChart := chart.StackedBarChart{
|
||||
Title: "Quarterly Sales",
|
||||
TitleStyle: chart.Shown(),
|
||||
TitleStyle: chart.StyleShow(),
|
||||
Background: chart.Style{
|
||||
Padding: chart.Box{
|
||||
Top: 100,
|
||||
|
@ -31,8 +31,8 @@ func main() {
|
|||
},
|
||||
Width: 810,
|
||||
Height: 500,
|
||||
XAxis: chart.Shown(),
|
||||
YAxis: chart.Shown(),
|
||||
XAxis: chart.StyleShow(),
|
||||
YAxis: chart.StyleShow(),
|
||||
BarSpacing: 50,
|
||||
Bars: []chart.StackedBar{
|
||||
{
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
@ -4,8 +4,8 @@ import (
|
|||
"image/color"
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestAnnotationSeriesMeasure(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"math"
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestBarChartRender(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"math"
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestBollingerBandSeries(t *testing.T) {
|
||||
|
|
16
box.go
16
box.go
|
@ -254,22 +254,6 @@ func (b Box) OuterConstrain(bounds, other Box) Box {
|
|||
return newBox
|
||||
}
|
||||
|
||||
func (b Box) Validate() error {
|
||||
if b.Left < 0 {
|
||||
return fmt.Errorf("invalid left; must be >= 0")
|
||||
}
|
||||
if b.Right < 0 {
|
||||
return fmt.Errorf("invalid right; must be > 0")
|
||||
}
|
||||
if b.Top < 0 {
|
||||
return fmt.Errorf("invalid top; must be > 0")
|
||||
}
|
||||
if b.Bottom < 0 {
|
||||
return fmt.Errorf("invalid bottom; must be > 0")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// BoxCorners is a box with independent corners.
|
||||
type BoxCorners struct {
|
||||
TopLeft, TopRight, BottomRight, BottomLeft Point
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"math"
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestBoxClone(t *testing.T) {
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestChartGetDPI(t *testing.T) {
|
||||
|
@ -573,22 +573,3 @@ func TestChartE2ELineWithFill(t *testing.T) {
|
|||
testutil.AssertEqual(t, defaultSeriesColor, at(i, 0, 49))
|
||||
testutil.AssertEqual(t, defaultSeriesColor, at(i, 49, 0))
|
||||
}
|
||||
|
||||
func Test_Chart_cve(t *testing.T) {
|
||||
poc := StackedBarChart{
|
||||
Title: "poc",
|
||||
Bars: []StackedBar{
|
||||
{
|
||||
Name: "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",
|
||||
Values: []Value{
|
||||
{Value: 1, Label: "infinite"},
|
||||
{Value: 1, Label: "loop"},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
var imgContent bytes.Buffer
|
||||
err := poc.Render(PNG, &imgContent)
|
||||
testutil.AssertNotNil(t, err)
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package chart
|
||||
|
||||
import "git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
import "github.com/wcharczuk/go-chart/v2/drawing"
|
||||
|
||||
var (
|
||||
// ColorWhite is white.
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestConcatSeries(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestRangeTranslate(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestContinuousSeries(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"bytes"
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestDonutChart(t *testing.T) {
|
||||
|
|
162
drawing/color.go
162
drawing/color.go
|
@ -2,46 +2,27 @@ package drawing
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Basic Colors from:
|
||||
// https://www.w3.org/wiki/CSS/Properties/color/keywords
|
||||
var (
|
||||
// ColorTransparent is a fully transparent color.
|
||||
ColorTransparent = Color{R: 255, G: 255, B: 255, A: 0}
|
||||
ColorTransparent = Color{}
|
||||
|
||||
// ColorWhite is white.
|
||||
ColorWhite = Color{R: 255, G: 255, B: 255, A: 255}
|
||||
|
||||
// ColorBlack is black.
|
||||
ColorBlack = Color{R: 0, G: 0, B: 0, A: 255}
|
||||
|
||||
// ColorRed is red.
|
||||
ColorRed = Color{R: 255, G: 0, B: 0, A: 255}
|
||||
|
||||
// ColorGreen is green.
|
||||
ColorGreen = Color{R: 0, G: 128, B: 0, A: 255}
|
||||
ColorGreen = Color{R: 0, G: 255, B: 0, A: 255}
|
||||
|
||||
// ColorBlue is blue.
|
||||
ColorBlue = Color{R: 0, G: 0, B: 255, A: 255}
|
||||
// ColorSilver is a known color.
|
||||
ColorSilver = Color{R: 192, G: 192, B: 192, A: 255}
|
||||
// ColorMaroon is a known color.
|
||||
ColorMaroon = Color{R: 128, G: 0, B: 0, A: 255}
|
||||
// ColorPurple is a known color.
|
||||
ColorPurple = Color{R: 128, G: 0, B: 128, A: 255}
|
||||
// ColorFuchsia is a known color.
|
||||
ColorFuchsia = Color{R: 255, G: 0, B: 255, A: 255}
|
||||
// ColorLime is a known color.
|
||||
ColorLime = Color{R: 0, G: 255, B: 0, A: 255}
|
||||
// ColorOlive is a known color.
|
||||
ColorOlive = Color{R: 128, G: 128, B: 0, A: 255}
|
||||
// ColorYellow is a known color.
|
||||
ColorYellow = Color{R: 255, G: 255, B: 0, A: 255}
|
||||
// ColorNavy is a known color.
|
||||
ColorNavy = Color{R: 0, G: 0, B: 128, A: 255}
|
||||
// ColorTeal is a known color.
|
||||
ColorTeal = Color{R: 0, G: 128, B: 128, A: 255}
|
||||
// ColorAqua is a known color.
|
||||
ColorAqua = Color{R: 0, G: 255, B: 255, A: 255}
|
||||
)
|
||||
|
||||
func parseHex(hex string) uint8 {
|
||||
|
@ -49,97 +30,8 @@ func parseHex(hex string) uint8 {
|
|||
return uint8(v)
|
||||
}
|
||||
|
||||
// ParseColor parses a color from a string.
|
||||
func ParseColor(rawColor string) Color {
|
||||
if strings.HasPrefix(rawColor, "rgba") {
|
||||
return ColorFromRGBA(rawColor)
|
||||
}
|
||||
if strings.HasPrefix(rawColor, "rgb") {
|
||||
return ColorFromRGB(rawColor)
|
||||
}
|
||||
if strings.HasPrefix(rawColor, "#") {
|
||||
return ColorFromHex(rawColor)
|
||||
}
|
||||
return ColorFromKnown(rawColor)
|
||||
}
|
||||
|
||||
var rgbaexpr = regexp.MustCompile(`rgba\((?P<R>.+),(?P<G>.+),(?P<B>.+),(?P<A>.+)\)`)
|
||||
|
||||
// ColorFromRGBA returns a color from an `rgba()` css function.
|
||||
func ColorFromRGBA(rgba string) (output Color) {
|
||||
values := rgbaexpr.FindStringSubmatch(rgba)
|
||||
for i, name := range rgbaexpr.SubexpNames() {
|
||||
if i == 0 {
|
||||
continue
|
||||
}
|
||||
if i >= len(values) {
|
||||
break
|
||||
}
|
||||
switch name {
|
||||
case "R":
|
||||
value := strings.TrimSpace(values[i])
|
||||
parsed, _ := strconv.ParseInt(value, 10, 16)
|
||||
output.R = uint8(parsed)
|
||||
case "G":
|
||||
value := strings.TrimSpace(values[i])
|
||||
parsed, _ := strconv.ParseInt(value, 10, 16)
|
||||
output.G = uint8(parsed)
|
||||
case "B":
|
||||
value := strings.TrimSpace(values[i])
|
||||
parsed, _ := strconv.ParseInt(value, 10, 16)
|
||||
output.B = uint8(parsed)
|
||||
case "A":
|
||||
value := strings.TrimSpace(values[i])
|
||||
parsed, _ := strconv.ParseFloat(value, 32)
|
||||
if parsed > 1 {
|
||||
parsed = 1
|
||||
} else if parsed < 0 {
|
||||
parsed = 0
|
||||
}
|
||||
output.A = uint8(parsed * 255)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
var rgbexpr = regexp.MustCompile(`rgb\((?P<R>.+),(?P<G>.+),(?P<B>.+)\)`)
|
||||
|
||||
// ColorFromRGB returns a color from an `rgb()` css function.
|
||||
func ColorFromRGB(rgb string) (output Color) {
|
||||
output.A = 255
|
||||
values := rgbexpr.FindStringSubmatch(rgb)
|
||||
for i, name := range rgbaexpr.SubexpNames() {
|
||||
if i == 0 {
|
||||
continue
|
||||
}
|
||||
if i >= len(values) {
|
||||
break
|
||||
}
|
||||
switch name {
|
||||
case "R":
|
||||
value := strings.TrimSpace(values[i])
|
||||
parsed, _ := strconv.ParseInt(value, 10, 16)
|
||||
output.R = uint8(parsed)
|
||||
case "G":
|
||||
value := strings.TrimSpace(values[i])
|
||||
parsed, _ := strconv.ParseInt(value, 10, 16)
|
||||
output.G = uint8(parsed)
|
||||
case "B":
|
||||
value := strings.TrimSpace(values[i])
|
||||
parsed, _ := strconv.ParseInt(value, 10, 16)
|
||||
output.B = uint8(parsed)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ColorFromHex returns a color from a css hex code.
|
||||
//
|
||||
// NOTE: it will trim a leading '#' character if present.
|
||||
func ColorFromHex(hex string) Color {
|
||||
if strings.HasPrefix(hex, "#") {
|
||||
hex = strings.TrimPrefix(hex, "#")
|
||||
}
|
||||
var c Color
|
||||
if len(hex) == 3 {
|
||||
c.R = parseHex(string(hex[0])) * 0x11
|
||||
|
@ -154,46 +46,6 @@ func ColorFromHex(hex string) Color {
|
|||
return c
|
||||
}
|
||||
|
||||
// ColorFromKnown returns an internal color from a known (basic) color name.
|
||||
func ColorFromKnown(known string) Color {
|
||||
switch strings.ToLower(known) {
|
||||
case "transparent":
|
||||
return ColorTransparent
|
||||
case "white":
|
||||
return ColorWhite
|
||||
case "black":
|
||||
return ColorBlack
|
||||
case "red":
|
||||
return ColorRed
|
||||
case "blue":
|
||||
return ColorBlue
|
||||
case "green":
|
||||
return ColorGreen
|
||||
case "silver":
|
||||
return ColorSilver
|
||||
case "maroon":
|
||||
return ColorMaroon
|
||||
case "purple":
|
||||
return ColorPurple
|
||||
case "fuchsia":
|
||||
return ColorFuchsia
|
||||
case "lime":
|
||||
return ColorLime
|
||||
case "olive":
|
||||
return ColorOlive
|
||||
case "yellow":
|
||||
return ColorYellow
|
||||
case "navy":
|
||||
return ColorNavy
|
||||
case "teal":
|
||||
return ColorTeal
|
||||
case "aqua":
|
||||
return ColorAqua
|
||||
default:
|
||||
return Color{}
|
||||
}
|
||||
}
|
||||
|
||||
// ColorFromAlphaMixedRGBA returns the system alpha mixed rgba values.
|
||||
func ColorFromAlphaMixedRGBA(r, g, b, a uint32) Color {
|
||||
fa := float64(a) / 255.0
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
package drawing
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"image/color"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestColorFromHex(t *testing.T) {
|
||||
// replaced new assertions helper
|
||||
|
||||
white := ColorFromHex("FFFFFF")
|
||||
testutil.AssertEqual(t, ColorWhite, white)
|
||||
|
||||
|
@ -28,11 +29,11 @@ func TestColorFromHex(t *testing.T) {
|
|||
shortRed := ColorFromHex("F00")
|
||||
testutil.AssertEqual(t, ColorRed, shortRed)
|
||||
|
||||
green := ColorFromHex("008000")
|
||||
green := ColorFromHex("00FF00")
|
||||
testutil.AssertEqual(t, ColorGreen, green)
|
||||
|
||||
// shortGreen := ColorFromHex("0F0")
|
||||
// testutil.AssertEqual(t, ColorGreen, shortGreen)
|
||||
shortGreen := ColorFromHex("0F0")
|
||||
testutil.AssertEqual(t, ColorGreen, shortGreen)
|
||||
|
||||
blue := ColorFromHex("0000FF")
|
||||
testutil.AssertEqual(t, ColorBlue, blue)
|
||||
|
@ -41,74 +42,12 @@ func TestColorFromHex(t *testing.T) {
|
|||
testutil.AssertEqual(t, ColorBlue, shortBlue)
|
||||
}
|
||||
|
||||
func TestColorFromHex_handlesHash(t *testing.T) {
|
||||
withHash := ColorFromHex("#FF0000")
|
||||
testutil.AssertEqual(t, ColorRed, withHash)
|
||||
|
||||
withoutHash := ColorFromHex("#FF0000")
|
||||
testutil.AssertEqual(t, ColorRed, withoutHash)
|
||||
}
|
||||
|
||||
func TestColorFromAlphaMixedRGBA(t *testing.T) {
|
||||
// replaced new assertions helper
|
||||
|
||||
black := ColorFromAlphaMixedRGBA(color.Black.RGBA())
|
||||
testutil.AssertTrue(t, black.Equals(ColorBlack), black.String())
|
||||
|
||||
white := ColorFromAlphaMixedRGBA(color.White.RGBA())
|
||||
testutil.AssertTrue(t, white.Equals(ColorWhite), white.String())
|
||||
}
|
||||
|
||||
func Test_ColorFromRGBA(t *testing.T) {
|
||||
value := "rgba(192, 192, 192, 1.0)"
|
||||
parsed := ColorFromRGBA(value)
|
||||
testutil.AssertEqual(t, ColorSilver, parsed)
|
||||
|
||||
value = "rgba(192,192,192,1.0)"
|
||||
parsed = ColorFromRGBA(value)
|
||||
testutil.AssertEqual(t, ColorSilver, parsed)
|
||||
|
||||
value = "rgba(192,192,192,1.5)"
|
||||
parsed = ColorFromRGBA(value)
|
||||
testutil.AssertEqual(t, ColorSilver, parsed)
|
||||
}
|
||||
|
||||
func TestParseColor(t *testing.T) {
|
||||
testCases := [...]struct {
|
||||
Input string
|
||||
Expected Color
|
||||
}{
|
||||
{"", Color{}},
|
||||
{"white", ColorWhite},
|
||||
{"WHITE", ColorWhite}, // caps!
|
||||
{"black", ColorBlack},
|
||||
{"red", ColorRed},
|
||||
{"green", ColorGreen},
|
||||
{"blue", ColorBlue},
|
||||
{"silver", ColorSilver},
|
||||
{"maroon", ColorMaroon},
|
||||
{"purple", ColorPurple},
|
||||
{"fuchsia", ColorFuchsia},
|
||||
{"lime", ColorLime},
|
||||
{"olive", ColorOlive},
|
||||
{"yellow", ColorYellow},
|
||||
{"navy", ColorNavy},
|
||||
{"teal", ColorTeal},
|
||||
{"aqua", ColorAqua},
|
||||
|
||||
{"rgba(192, 192, 192, 1.0)", ColorSilver},
|
||||
{"rgba(192,192,192,1.0)", ColorSilver},
|
||||
{"rgb(192, 192, 192)", ColorSilver},
|
||||
{"rgb(192,192,192)", ColorSilver},
|
||||
|
||||
{"#FF0000", ColorRed},
|
||||
{"#008000", ColorGreen},
|
||||
{"#0000FF", ColorBlue},
|
||||
{"#F00", ColorRed},
|
||||
{"#080", Color{0, 136, 0, 255}},
|
||||
{"#00F", ColorBlue},
|
||||
}
|
||||
|
||||
for index, tc := range testCases {
|
||||
actual := ParseColor(tc.Input)
|
||||
testutil.AssertEqual(t, tc.Expected, actual, fmt.Sprintf("test case: %d -> %s", index, tc.Input))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package drawing
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
type point struct {
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
chart "git.smarteching.com/zeni/go-chart/v2"
|
||||
chart "github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
chart "git.smarteching.com/zeni/go-chart/v2"
|
||||
chart "github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
@ -5,8 +5,8 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
package main
|
||||
|
||||
//go:generate go run main.go
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
)
|
||||
|
||||
func drawChart(res http.ResponseWriter, req *http.Request) {
|
||||
graph := chart.BarChart{
|
||||
Title: "Test Bar Chart",
|
||||
Background: chart.Style{
|
||||
Padding: chart.Box{
|
||||
Top: 40,
|
||||
},
|
||||
},
|
||||
Height: 512,
|
||||
BarWidth: 60,
|
||||
Bars: []chart.Value{
|
||||
{Value: 5.25, Label: "Blue"},
|
||||
{Value: 4.88, Label: "Green"},
|
||||
{Value: 4.74, Label: "Gray"},
|
||||
{Value: 3.22, Label: "Orange"},
|
||||
{Value: 3, Label: "Test"},
|
||||
{Value: 2.27, Label: "??"},
|
||||
{Value: 1, Label: "!!"},
|
||||
},
|
||||
}
|
||||
|
||||
res.Header().Set("Content-Type", "image/png")
|
||||
err := graph.Render(chart.PNG, res)
|
||||
if err != nil {
|
||||
fmt.Printf("Error rendering chart: %v\n", err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func port() string {
|
||||
if len(os.Getenv("PORT")) > 0 {
|
||||
return os.Getenv("PORT")
|
||||
}
|
||||
return "8080"
|
||||
}
|
||||
|
||||
func main() {
|
||||
listenPort := fmt.Sprintf(":%s", port())
|
||||
fmt.Printf("Listening on %s\n", listenPort)
|
||||
http.HandleFunc("/", drawChart)
|
||||
log.Fatal(http.ListenAndServe(listenPort, nil))
|
||||
}
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"os"
|
||||
"time"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func random(min, max float64) float64 {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"log"
|
||||
"net/http"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
// Note: Additional examples on how to add Stylesheets are in the custom_stylesheets example
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,8 +5,8 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,8 +5,8 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"log"
|
||||
"net/http"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
const style = "svg .background { fill: white; }" +
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
chart "git.smarteching.com/zeni/go-chart/v2"
|
||||
chart "github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
chart "git.smarteching.com/zeni/go-chart/v2"
|
||||
chart "github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
)
|
||||
|
||||
func drawChart(res http.ResponseWriter, req *http.Request) {
|
||||
pie := chart.PieChart{
|
||||
Width: 512,
|
||||
Height: 512,
|
||||
Values: []chart.Value{
|
||||
{Value: 5, Label: "Blue"},
|
||||
{Value: 5, Label: "Green"},
|
||||
{Value: 4, Label: "Gray"},
|
||||
{Value: 4, Label: "Orange"},
|
||||
{Value: 3, Label: "Deep Blue"},
|
||||
{Value: 3, Label: "??"},
|
||||
{Value: 1, Label: "!!"},
|
||||
},
|
||||
}
|
||||
|
||||
res.Header().Set("Content-Type", "image/png")
|
||||
err := pie.Render(chart.PNG, res)
|
||||
if err != nil {
|
||||
fmt.Printf("Error rendering pie chart: %v\n", err)
|
||||
}
|
||||
}
|
||||
|
||||
func drawChartRegression(res http.ResponseWriter, req *http.Request) {
|
||||
pie := chart.PieChart{
|
||||
Width: 512,
|
||||
Height: 512,
|
||||
Values: []chart.Value{
|
||||
{Value: 5, Label: "Blue"},
|
||||
{Value: 2, Label: "Two"},
|
||||
{Value: 1, Label: "One"},
|
||||
},
|
||||
}
|
||||
|
||||
res.Header().Set("Content-Type", chart.ContentTypeSVG)
|
||||
err := pie.Render(chart.SVG, res)
|
||||
if err != nil {
|
||||
fmt.Printf("Error rendering pie chart: %v\n", err)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", drawChart)
|
||||
http.HandleFunc("/reg", drawChartRegression)
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
}
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
chart "git.smarteching.com/zeni/go-chart/v2"
|
||||
chart "github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"strconv"
|
||||
"time"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
var lock sync.Mutex
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
|
||||
_ "net/http/pprof"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
)
|
||||
|
||||
func drawChart(res http.ResponseWriter, req *http.Request) {
|
||||
|
|
|
@ -5,7 +5,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"os"
|
||||
"time"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,8 +5,8 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"net/http"
|
||||
"time"
|
||||
|
||||
chart "git.smarteching.com/zeni/go-chart/v2"
|
||||
chart "github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func drawChart(res http.ResponseWriter, req *http.Request) {
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"log"
|
||||
"os"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestFirstValueAnnotation(t *testing.T) {
|
||||
|
|
2
font.go
2
font.go
|
@ -3,8 +3,8 @@ package chart
|
|||
import (
|
||||
"sync"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/roboto"
|
||||
"github.com/golang/freetype/truetype"
|
||||
"github.com/wcharczuk/go-chart/v2/roboto"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
6
go.mod
6
go.mod
|
@ -1,8 +1,8 @@
|
|||
module git.smarteching.com/zeni/go-chart/v2
|
||||
module github.com/wcharczuk/go-chart/v2
|
||||
|
||||
go 1.23.1
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
|
||||
golang.org/x/image v0.21.0
|
||||
golang.org/x/image v0.0.0-20200927104501-e162460cd6b5
|
||||
)
|
||||
|
|
5
go.sum
5
go.sum
|
@ -1,4 +1,5 @@
|
|||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
|
||||
golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s=
|
||||
golang.org/x/image v0.21.0/go.mod h1:vUbsLavqK/W303ZroQQVKQ+Af3Yl6Uz1Ppu5J/cLz78=
|
||||
golang.org/x/image v0.0.0-20200927104501-e162460cd6b5 h1:QelT11PB4FXiDEXucrfNckHoFxwt8USGY1ajP1ZF5lM=
|
||||
golang.org/x/image v0.0.0-20200927104501-e162460cd6b5/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestGenerateGridLines(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestHistogramSeries(t *testing.T) {
|
||||
|
|
2
jet.go
2
jet.go
|
@ -1,6 +1,6 @@
|
|||
package chart
|
||||
|
||||
import "git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
import "github.com/wcharczuk/go-chart/v2/drawing"
|
||||
|
||||
// Jet is a color map provider based on matlab's jet color map.
|
||||
func Jet(v, vmin, vmax float64) drawing.Color {
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestLastValueAnnotationSeries(t *testing.T) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package chart
|
||||
|
||||
import (
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
)
|
||||
|
||||
// Legend returns a legend renderable function.
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"bytes"
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestLegend(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestLinearRegressionSeries(t *testing.T) {
|
||||
|
|
|
@ -3,41 +3,44 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/blend/go-sdk/assert"
|
||||
)
|
||||
|
||||
func TestLogRangeTranslate(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
values := []float64{1, 10, 100, 1000, 10000, 100000, 1000000}
|
||||
r := LogarithmicRange{Domain: 1000}
|
||||
r.Min, r.Max = MinMax(values...)
|
||||
|
||||
testutil.AssertEqual(t, 0, r.Translate(0)) // goes to bottom
|
||||
testutil.AssertEqual(t, 0, r.Translate(1)) // goes to bottom
|
||||
testutil.AssertEqual(t, 160, r.Translate(10)) // roughly 1/6th of max
|
||||
testutil.AssertEqual(t, 500, r.Translate(1000)) // roughly 1/2 of max (1.0e6 / 1.0e3)
|
||||
testutil.AssertEqual(t, 1000, r.Translate(1000000)) // max value
|
||||
assert.Equal(0, r.Translate(0)) // goes to bottom
|
||||
assert.Equal(0, r.Translate(1)) // goes to bottom
|
||||
assert.Equal(160, r.Translate(10)) // roughly 1/6th of max
|
||||
assert.Equal(500, r.Translate(1000)) // roughly 1/2 of max (1.0e6 / 1.0e3)
|
||||
assert.Equal(1000, r.Translate(1000000)) // max value
|
||||
}
|
||||
|
||||
func TestGetTicks(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
values := []float64{35, 512, 1525122}
|
||||
r := LogarithmicRange{Domain: 1000}
|
||||
r.Min, r.Max = MinMax(values...)
|
||||
|
||||
ticks := r.GetTicks(nil, Style{}, FloatValueFormatter)
|
||||
testutil.AssertEqual(t, 7, len(ticks))
|
||||
testutil.AssertEqual(t, 10, ticks[0].Value)
|
||||
testutil.AssertEqual(t, 100, ticks[1].Value)
|
||||
testutil.AssertEqual(t, 10000000, ticks[6].Value)
|
||||
assert.Equal(7, len(ticks))
|
||||
assert.Equal(10, ticks[0].Value)
|
||||
assert.Equal(100, ticks[1].Value)
|
||||
assert.Equal(10000000, ticks[6].Value)
|
||||
}
|
||||
|
||||
func TestGetTicksFromHigh(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
values := []float64{1412, 352144, 1525122} // min tick should be 1000
|
||||
r := LogarithmicRange{}
|
||||
r.Min, r.Max = MinMax(values...)
|
||||
|
||||
ticks := r.GetTicks(nil, Style{}, FloatValueFormatter)
|
||||
testutil.AssertEqual(t, 5, len(ticks))
|
||||
testutil.AssertEqual(t, float64(1000), ticks[0].Value)
|
||||
testutil.AssertEqual(t, float64(10000), ticks[1].Value)
|
||||
testutil.AssertEqual(t, float64(10000000), ticks[4].Value)
|
||||
assert.Equal(5, len(ticks))
|
||||
assert.Equal(float64(1000), ticks[0].Value)
|
||||
assert.Equal(float64(10000), ticks[1].Value)
|
||||
assert.Equal(float64(10000000), ticks[4].Value)
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -3,7 +3,7 @@ package matrix
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package matrix
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestPoly(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestPercentageDifferenceSeries(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"bytes"
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestPieChart(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"math"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/matrix"
|
||||
"github.com/wcharczuk/go-chart/v2/matrix"
|
||||
)
|
||||
|
||||
// Interface Assertions.
|
||||
|
|
|
@ -3,8 +3,8 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/matrix"
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/matrix"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestPolynomialRegression(t *testing.T) {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"io"
|
||||
"math"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"github.com/golang/freetype/truetype"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
)
|
||||
|
||||
// PNG returns a new png/raster renderer.
|
||||
|
|
|
@ -3,8 +3,8 @@ package chart
|
|||
import (
|
||||
"io"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"github.com/golang/freetype/truetype"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
)
|
||||
|
||||
// Renderer represents the basic methods required to draw a chart.
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestSeqEach(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
type mockValuesProvider struct {
|
||||
|
|
|
@ -118,18 +118,12 @@ func (sbc StackedBarChart) Render(rp RendererProvider, w io.Writer) error {
|
|||
var canvasBox Box
|
||||
if sbc.IsHorizontal {
|
||||
canvasBox = sbc.getHorizontalAdjustedCanvasBox(r, sbc.getDefaultCanvasBox())
|
||||
if err := canvasBox.Validate(); err != nil {
|
||||
return fmt.Errorf("invalid canvas box: %w", err)
|
||||
}
|
||||
sbc.drawCanvas(r, canvasBox)
|
||||
sbc.drawHorizontalBars(r, canvasBox)
|
||||
sbc.drawHorizontalXAxis(r, canvasBox)
|
||||
sbc.drawHorizontalYAxis(r, canvasBox)
|
||||
} else {
|
||||
canvasBox = sbc.getAdjustedCanvasBox(r, sbc.getDefaultCanvasBox())
|
||||
if err := canvasBox.Validate(); err != nil {
|
||||
return fmt.Errorf("invalid canvas box: %w", err)
|
||||
}
|
||||
sbc.drawCanvas(r, canvasBox)
|
||||
sbc.drawBars(r, canvasBox)
|
||||
sbc.drawXAxis(r, canvasBox)
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestSplitCSV(t *testing.T) {
|
||||
|
|
2
style.go
2
style.go
|
@ -4,8 +4,8 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"github.com/golang/freetype/truetype"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -3,9 +3,9 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/golang/freetype/truetype"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestStyleIsZero(t *testing.T) {
|
||||
|
|
|
@ -9,7 +9,6 @@ import (
|
|||
|
||||
// AssertNil asserts an argument is nil.
|
||||
func AssertNil(t *testing.T, actual interface{}) {
|
||||
t.Helper()
|
||||
if !isNil(actual) {
|
||||
t.Errorf("assertion failed; expected actual to be nil")
|
||||
t.FailNow()
|
||||
|
@ -18,7 +17,6 @@ func AssertNil(t *testing.T, actual interface{}) {
|
|||
|
||||
// AssertNotNil asserts an argument is not nil.
|
||||
func AssertNotNil(t *testing.T, actual interface{}, message ...interface{}) {
|
||||
t.Helper()
|
||||
if isNil(actual) {
|
||||
t.Error("assertion failed; expected actual to not be nil")
|
||||
if len(message) > 0 {
|
||||
|
@ -30,7 +28,6 @@ func AssertNotNil(t *testing.T, actual interface{}, message ...interface{}) {
|
|||
|
||||
// AssertEqual asserts two arguments are equal.
|
||||
func AssertEqual(t *testing.T, expected, actual interface{}, message ...interface{}) {
|
||||
t.Helper()
|
||||
if !equal(expected, actual) {
|
||||
t.Errorf("assertion failed; expected %v to equal %v", actual, expected)
|
||||
if len(message) > 0 {
|
||||
|
@ -42,7 +39,6 @@ func AssertEqual(t *testing.T, expected, actual interface{}, message ...interfac
|
|||
|
||||
// AssertNotEqual asserts two arguments are not equal.
|
||||
func AssertNotEqual(t *testing.T, expected, actual interface{}, message ...interface{}) {
|
||||
t.Helper()
|
||||
if equal(expected, actual) {
|
||||
t.Errorf("assertion failed; expected %v to not equal %v", actual, expected)
|
||||
if len(message) > 0 {
|
||||
|
@ -54,19 +50,16 @@ func AssertNotEqual(t *testing.T, expected, actual interface{}, message ...inter
|
|||
|
||||
// AssertZero asserts an argument is zero.
|
||||
func AssertZero(t *testing.T, actual interface{}, message ...interface{}) {
|
||||
t.Helper()
|
||||
AssertEqual(t, 0, actual)
|
||||
}
|
||||
|
||||
// AssertNotZero asserts an argument is not zero.
|
||||
func AssertNotZero(t *testing.T, actual interface{}, message ...interface{}) {
|
||||
t.Helper()
|
||||
AssertNotEqual(t, 0, actual)
|
||||
}
|
||||
|
||||
// AssertTrue asserts an argument is true.
|
||||
func AssertTrue(t *testing.T, arg bool, message ...interface{}) {
|
||||
t.Helper()
|
||||
if !arg {
|
||||
t.Errorf("assertion failed; expected actual to be true")
|
||||
if len(message) > 0 {
|
||||
|
@ -78,7 +71,6 @@ func AssertTrue(t *testing.T, arg bool, message ...interface{}) {
|
|||
|
||||
// AssertFalse asserts an argument is false.
|
||||
func AssertFalse(t *testing.T, arg bool, message ...interface{}) {
|
||||
t.Helper()
|
||||
if arg {
|
||||
t.Errorf("assertion failed; expected actual to be false")
|
||||
if len(message) > 0 {
|
||||
|
@ -92,7 +84,6 @@ func AssertFalse(t *testing.T, arg bool, message ...interface{}) {
|
|||
//
|
||||
// This delta will be determined absolute, and the delta should always be positive.
|
||||
func AssertInDelta(t *testing.T, from, to, delta float64, message ...interface{}) {
|
||||
t.Helper()
|
||||
if diff := math.Abs(from - to); diff > delta {
|
||||
t.Errorf("assertion failed; expected absolute difference of %f and %f to be %f", from, to, delta)
|
||||
if len(message) > 0 {
|
||||
|
@ -104,7 +95,6 @@ func AssertInDelta(t *testing.T, from, to, delta float64, message ...interface{}
|
|||
|
||||
// AssertEmpty asserts an argument is empty.
|
||||
func AssertEmpty(t *testing.T, arg interface{}, message ...interface{}) {
|
||||
t.Helper()
|
||||
if getLength(arg) != 0 {
|
||||
t.Errorf("assertion failed; expected actual to be empty")
|
||||
if len(message) > 0 {
|
||||
|
@ -116,7 +106,6 @@ func AssertEmpty(t *testing.T, arg interface{}, message ...interface{}) {
|
|||
|
||||
// AssertNotEmpty asserts an argument is not empty.
|
||||
func AssertNotEmpty(t *testing.T, arg interface{}, message ...interface{}) {
|
||||
t.Helper()
|
||||
if getLength(arg) == 0 {
|
||||
t.Errorf("assertion failed; expected actual to not be empty")
|
||||
if len(message) > 0 {
|
||||
|
@ -128,7 +117,6 @@ func AssertNotEmpty(t *testing.T, arg interface{}, message ...interface{}) {
|
|||
|
||||
// AssertLen asserts an argument has a given length.
|
||||
func AssertLen(t *testing.T, arg interface{}, length int, message ...interface{}) {
|
||||
t.Helper()
|
||||
if getLength(arg) != length {
|
||||
t.Errorf("assertion failed; expected actual to have length %d", length)
|
||||
if len(message) > 0 {
|
||||
|
@ -140,7 +128,6 @@ func AssertLen(t *testing.T, arg interface{}, length int, message ...interface{}
|
|||
|
||||
// AssertContains asserts an argument contains a given substring.
|
||||
func AssertContains(t *testing.T, s, substr string, message ...interface{}) {
|
||||
t.Helper()
|
||||
if !strings.Contains(s, substr) {
|
||||
t.Errorf("assertion failed; expected actual to contain %q", substr)
|
||||
if len(message) > 0 {
|
||||
|
@ -152,7 +139,6 @@ func AssertContains(t *testing.T, s, substr string, message ...interface{}) {
|
|||
|
||||
// AssertNotContains asserts an argument does not contain a given substring.
|
||||
func AssertNotContains(t *testing.T, s, substr string, message ...interface{}) {
|
||||
t.Helper()
|
||||
if strings.Contains(s, substr) {
|
||||
t.Errorf("assertion failed; expected actual to not contain %q", substr)
|
||||
if len(message) > 0 {
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestTextWrapWord(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestGenerateContinuousTicks(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestTimeSeriesGetValue(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestBuffer(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestTimeValueFormatterWithFormat(t *testing.T) {
|
||||
|
@ -58,7 +58,8 @@ func TestFloatValueFormatterWithFormat(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestExponentialValueFormatter(t *testing.T) {
|
||||
testutil.AssertEqual(t, "1.23e+02", ExponentialValueFormatter(123.456))
|
||||
testutil.AssertEqual(t, "1.24e+07", ExponentialValueFormatter(12421243.424))
|
||||
testutil.AssertEqual(t, "4.50e-01", ExponentialValueFormatter(0.45))
|
||||
assert := assert.New(t)
|
||||
assert.Equal("1.23e+02", ExponentialValueFormatter(123.456))
|
||||
assert.Equal("1.24e+07", ExponentialValueFormatter(12421243.424))
|
||||
assert.Equal("4.50e-01", ExponentialValueFormatter(0.45))
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package chart
|
||||
|
||||
import "git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
import "github.com/wcharczuk/go-chart/v2/drawing"
|
||||
|
||||
// ValuesProvider is a type that produces values.
|
||||
type ValuesProvider interface {
|
||||
|
|
|
@ -3,7 +3,7 @@ package chart
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestValuesValues(t *testing.T) {
|
||||
|
|
|
@ -9,8 +9,8 @@ import (
|
|||
|
||||
"golang.org/x/image/font"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"github.com/golang/freetype/truetype"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
)
|
||||
|
||||
// SVG returns a new png/raster renderer.
|
||||
|
@ -247,7 +247,7 @@ type canvas struct {
|
|||
func (c *canvas) Start(width, height int) {
|
||||
c.width = width
|
||||
c.height = height
|
||||
c.w.Write([]byte(fmt.Sprintf(`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 %d %d">`, c.width, c.height)))
|
||||
c.w.Write([]byte(fmt.Sprintf(`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="%d" height="%d">\n`, c.width, c.height)))
|
||||
if c.css != "" {
|
||||
c.w.Write([]byte(`<style type="text/css"`))
|
||||
if c.nonce != "" {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
"git.smarteching.com/zeni/go-chart/v2/testutil"
|
||||
"github.com/wcharczuk/go-chart/v2/drawing"
|
||||
"github.com/wcharczuk/go-chart/v2/testutil"
|
||||
)
|
||||
|
||||
func TestVectorRendererPath(t *testing.T) {
|
||||
|
|
514
viridis.go
514
viridis.go
|
@ -1,264 +1,264 @@
|
|||
package chart
|
||||
|
||||
import "git.smarteching.com/zeni/go-chart/v2/drawing"
|
||||
import "github.com/wcharczuk/go-chart/v2/drawing"
|
||||
|
||||
var viridisColors = [256]drawing.Color{
|
||||
{R: 0x44, G: 0x1, B: 0x54, A: 0xff},
|
||||
{R: 0x44, G: 0x2, B: 0x55, A: 0xff},
|
||||
{R: 0x45, G: 0x3, B: 0x57, A: 0xff},
|
||||
{R: 0x45, G: 0x5, B: 0x58, A: 0xff},
|
||||
{R: 0x45, G: 0x6, B: 0x5a, A: 0xff},
|
||||
{R: 0x46, G: 0x8, B: 0x5b, A: 0xff},
|
||||
{R: 0x46, G: 0x9, B: 0x5d, A: 0xff},
|
||||
{R: 0x46, G: 0xb, B: 0x5e, A: 0xff},
|
||||
{R: 0x46, G: 0xc, B: 0x60, A: 0xff},
|
||||
{R: 0x47, G: 0xe, B: 0x61, A: 0xff},
|
||||
{R: 0x47, G: 0xf, B: 0x62, A: 0xff},
|
||||
{R: 0x47, G: 0x11, B: 0x64, A: 0xff},
|
||||
{R: 0x47, G: 0x12, B: 0x65, A: 0xff},
|
||||
{R: 0x47, G: 0x14, B: 0x66, A: 0xff},
|
||||
{R: 0x48, G: 0x15, B: 0x68, A: 0xff},
|
||||
{R: 0x48, G: 0x16, B: 0x69, A: 0xff},
|
||||
{R: 0x48, G: 0x18, B: 0x6a, A: 0xff},
|
||||
{R: 0x48, G: 0x19, B: 0x6c, A: 0xff},
|
||||
{R: 0x48, G: 0x1a, B: 0x6d, A: 0xff},
|
||||
{R: 0x48, G: 0x1c, B: 0x6e, A: 0xff},
|
||||
{R: 0x48, G: 0x1d, B: 0x6f, A: 0xff},
|
||||
{R: 0x48, G: 0x1e, B: 0x70, A: 0xff},
|
||||
{R: 0x48, G: 0x20, B: 0x71, A: 0xff},
|
||||
{R: 0x48, G: 0x21, B: 0x73, A: 0xff},
|
||||
{R: 0x48, G: 0x22, B: 0x74, A: 0xff},
|
||||
{R: 0x48, G: 0x24, B: 0x75, A: 0xff},
|
||||
{R: 0x48, G: 0x25, B: 0x76, A: 0xff},
|
||||
{R: 0x48, G: 0x26, B: 0x77, A: 0xff},
|
||||
{R: 0x48, G: 0x27, B: 0x78, A: 0xff},
|
||||
{R: 0x47, G: 0x29, B: 0x79, A: 0xff},
|
||||
{R: 0x47, G: 0x2a, B: 0x79, A: 0xff},
|
||||
{R: 0x47, G: 0x2b, B: 0x7a, A: 0xff},
|
||||
{R: 0x47, G: 0x2c, B: 0x7b, A: 0xff},
|
||||
{R: 0x47, G: 0x2e, B: 0x7c, A: 0xff},
|
||||
{R: 0x46, G: 0x2f, B: 0x7d, A: 0xff},
|
||||
{R: 0x46, G: 0x30, B: 0x7e, A: 0xff},
|
||||
{R: 0x46, G: 0x31, B: 0x7e, A: 0xff},
|
||||
{R: 0x46, G: 0x33, B: 0x7f, A: 0xff},
|
||||
{R: 0x45, G: 0x34, B: 0x80, A: 0xff},
|
||||
{R: 0x45, G: 0x35, B: 0x81, A: 0xff},
|
||||
{R: 0x45, G: 0x36, B: 0x81, A: 0xff},
|
||||
{R: 0x44, G: 0x38, B: 0x82, A: 0xff},
|
||||
{R: 0x44, G: 0x39, B: 0x83, A: 0xff},
|
||||
{R: 0x44, G: 0x3a, B: 0x83, A: 0xff},
|
||||
{R: 0x43, G: 0x3b, B: 0x84, A: 0xff},
|
||||
{R: 0x43, G: 0x3c, B: 0x84, A: 0xff},
|
||||
{R: 0x43, G: 0x3e, B: 0x85, A: 0xff},
|
||||
{R: 0x42, G: 0x3f, B: 0x85, A: 0xff},
|
||||
{R: 0x42, G: 0x40, B: 0x86, A: 0xff},
|
||||
{R: 0x41, G: 0x41, B: 0x86, A: 0xff},
|
||||
{R: 0x41, G: 0x42, B: 0x87, A: 0xff},
|
||||
{R: 0x41, G: 0x43, B: 0x87, A: 0xff},
|
||||
{R: 0x40, G: 0x45, B: 0x88, A: 0xff},
|
||||
{R: 0x40, G: 0x46, B: 0x88, A: 0xff},
|
||||
{R: 0x3f, G: 0x47, B: 0x88, A: 0xff},
|
||||
{R: 0x3f, G: 0x48, B: 0x89, A: 0xff},
|
||||
{R: 0x3e, G: 0x49, B: 0x89, A: 0xff},
|
||||
{R: 0x3e, G: 0x4a, B: 0x89, A: 0xff},
|
||||
{R: 0x3d, G: 0x4b, B: 0x8a, A: 0xff},
|
||||
{R: 0x3d, G: 0x4d, B: 0x8a, A: 0xff},
|
||||
{R: 0x3c, G: 0x4e, B: 0x8a, A: 0xff},
|
||||
{R: 0x3c, G: 0x4f, B: 0x8a, A: 0xff},
|
||||
{R: 0x3b, G: 0x50, B: 0x8b, A: 0xff},
|
||||
{R: 0x3b, G: 0x51, B: 0x8b, A: 0xff},
|
||||
{R: 0x3a, G: 0x52, B: 0x8b, A: 0xff},
|
||||
{R: 0x3a, G: 0x53, B: 0x8b, A: 0xff},
|
||||
{R: 0x39, G: 0x54, B: 0x8c, A: 0xff},
|
||||
{R: 0x39, G: 0x55, B: 0x8c, A: 0xff},
|
||||
{R: 0x38, G: 0x56, B: 0x8c, A: 0xff},
|
||||
{R: 0x38, G: 0x57, B: 0x8c, A: 0xff},
|
||||
{R: 0x37, G: 0x58, B: 0x8c, A: 0xff},
|
||||
{R: 0x37, G: 0x59, B: 0x8c, A: 0xff},
|
||||
{R: 0x36, G: 0x5b, B: 0x8d, A: 0xff},
|
||||
{R: 0x36, G: 0x5c, B: 0x8d, A: 0xff},
|
||||
{R: 0x35, G: 0x5d, B: 0x8d, A: 0xff},
|
||||
{R: 0x35, G: 0x5e, B: 0x8d, A: 0xff},
|
||||
{R: 0x34, G: 0x5f, B: 0x8d, A: 0xff},
|
||||
{R: 0x34, G: 0x60, B: 0x8d, A: 0xff},
|
||||
{R: 0x33, G: 0x61, B: 0x8d, A: 0xff},
|
||||
{R: 0x33, G: 0x62, B: 0x8d, A: 0xff},
|
||||
{R: 0x33, G: 0x63, B: 0x8d, A: 0xff},
|
||||
{R: 0x32, G: 0x64, B: 0x8e, A: 0xff},
|
||||
{R: 0x32, G: 0x65, B: 0x8e, A: 0xff},
|
||||
{R: 0x31, G: 0x66, B: 0x8e, A: 0xff},
|
||||
{R: 0x31, G: 0x67, B: 0x8e, A: 0xff},
|
||||
{R: 0x30, G: 0x68, B: 0x8e, A: 0xff},
|
||||
{R: 0x30, G: 0x69, B: 0x8e, A: 0xff},
|
||||
{R: 0x2f, G: 0x6a, B: 0x8e, A: 0xff},
|
||||
{R: 0x2f, G: 0x6b, B: 0x8e, A: 0xff},
|
||||
{R: 0x2f, G: 0x6c, B: 0x8e, A: 0xff},
|
||||
{R: 0x2e, G: 0x6d, B: 0x8e, A: 0xff},
|
||||
{R: 0x2e, G: 0x6e, B: 0x8e, A: 0xff},
|
||||
{R: 0x2d, G: 0x6f, B: 0x8e, A: 0xff},
|
||||
{R: 0x2d, G: 0x70, B: 0x8e, A: 0xff},
|
||||
{R: 0x2d, G: 0x70, B: 0x8e, A: 0xff},
|
||||
{R: 0x2c, G: 0x71, B: 0x8e, A: 0xff},
|
||||
{R: 0x2c, G: 0x72, B: 0x8e, A: 0xff},
|
||||
{R: 0x2b, G: 0x73, B: 0x8e, A: 0xff},
|
||||
{R: 0x2b, G: 0x74, B: 0x8e, A: 0xff},
|
||||
{R: 0x2b, G: 0x75, B: 0x8e, A: 0xff},
|
||||
{R: 0x2a, G: 0x76, B: 0x8e, A: 0xff},
|
||||
{R: 0x2a, G: 0x77, B: 0x8e, A: 0xff},
|
||||
{R: 0x29, G: 0x78, B: 0x8e, A: 0xff},
|
||||
{R: 0x29, G: 0x79, B: 0x8e, A: 0xff},
|
||||
{R: 0x29, G: 0x7a, B: 0x8e, A: 0xff},
|
||||
{R: 0x28, G: 0x7b, B: 0x8e, A: 0xff},
|
||||
{R: 0x28, G: 0x7c, B: 0x8e, A: 0xff},
|
||||
{R: 0x28, G: 0x7d, B: 0x8e, A: 0xff},
|
||||
{R: 0x27, G: 0x7e, B: 0x8e, A: 0xff},
|
||||
{R: 0x27, G: 0x7f, B: 0x8e, A: 0xff},
|
||||
{R: 0x26, G: 0x80, B: 0x8e, A: 0xff},
|
||||
{R: 0x26, G: 0x81, B: 0x8e, A: 0xff},
|
||||
{R: 0x26, G: 0x82, B: 0x8e, A: 0xff},
|
||||
{R: 0x25, G: 0x83, B: 0x8e, A: 0xff},
|
||||
{R: 0x25, G: 0x83, B: 0x8e, A: 0xff},
|
||||
{R: 0x25, G: 0x84, B: 0x8e, A: 0xff},
|
||||
{R: 0x24, G: 0x85, B: 0x8e, A: 0xff},
|
||||
{R: 0x24, G: 0x86, B: 0x8e, A: 0xff},
|
||||
{R: 0x23, G: 0x87, B: 0x8e, A: 0xff},
|
||||
{R: 0x23, G: 0x88, B: 0x8e, A: 0xff},
|
||||
{R: 0x23, G: 0x89, B: 0x8e, A: 0xff},
|
||||
{R: 0x22, G: 0x8a, B: 0x8d, A: 0xff},
|
||||
{R: 0x22, G: 0x8b, B: 0x8d, A: 0xff},
|
||||
{R: 0x22, G: 0x8c, B: 0x8d, A: 0xff},
|
||||
{R: 0x21, G: 0x8d, B: 0x8d, A: 0xff},
|
||||
{R: 0x21, G: 0x8e, B: 0x8d, A: 0xff},
|
||||
{R: 0x21, G: 0x8f, B: 0x8d, A: 0xff},
|
||||
{R: 0x20, G: 0x90, B: 0x8d, A: 0xff},
|
||||
{R: 0x20, G: 0x91, B: 0x8c, A: 0xff},
|
||||
{R: 0x20, G: 0x92, B: 0x8c, A: 0xff},
|
||||
{R: 0x20, G: 0x93, B: 0x8c, A: 0xff},
|
||||
{R: 0x1f, G: 0x93, B: 0x8c, A: 0xff},
|
||||
{R: 0x1f, G: 0x94, B: 0x8c, A: 0xff},
|
||||
{R: 0x1f, G: 0x95, B: 0x8b, A: 0xff},
|
||||
{R: 0x1f, G: 0x96, B: 0x8b, A: 0xff},
|
||||
{R: 0x1f, G: 0x97, B: 0x8b, A: 0xff},
|
||||
{R: 0x1e, G: 0x98, B: 0x8b, A: 0xff},
|
||||
{R: 0x1e, G: 0x99, B: 0x8a, A: 0xff},
|
||||
{R: 0x1e, G: 0x9a, B: 0x8a, A: 0xff},
|
||||
{R: 0x1e, G: 0x9b, B: 0x8a, A: 0xff},
|
||||
{R: 0x1e, G: 0x9c, B: 0x89, A: 0xff},
|
||||
{R: 0x1e, G: 0x9d, B: 0x89, A: 0xff},
|
||||
{R: 0x1e, G: 0x9e, B: 0x89, A: 0xff},
|
||||
{R: 0x1e, G: 0x9f, B: 0x88, A: 0xff},
|
||||
{R: 0x1e, G: 0xa0, B: 0x88, A: 0xff},
|
||||
{R: 0x1f, G: 0xa1, B: 0x88, A: 0xff},
|
||||
{R: 0x1f, G: 0xa2, B: 0x87, A: 0xff},
|
||||
{R: 0x1f, G: 0xa3, B: 0x87, A: 0xff},
|
||||
{R: 0x1f, G: 0xa3, B: 0x86, A: 0xff},
|
||||
{R: 0x20, G: 0xa4, B: 0x86, A: 0xff},
|
||||
{R: 0x20, G: 0xa5, B: 0x86, A: 0xff},
|
||||
{R: 0x21, G: 0xa6, B: 0x85, A: 0xff},
|
||||
{R: 0x21, G: 0xa7, B: 0x85, A: 0xff},
|
||||
{R: 0x22, G: 0xa8, B: 0x84, A: 0xff},
|
||||
{R: 0x23, G: 0xa9, B: 0x83, A: 0xff},
|
||||
{R: 0x23, G: 0xaa, B: 0x83, A: 0xff},
|
||||
{R: 0x24, G: 0xab, B: 0x82, A: 0xff},
|
||||
{R: 0x25, G: 0xac, B: 0x82, A: 0xff},
|
||||
{R: 0x26, G: 0xad, B: 0x81, A: 0xff},
|
||||
{R: 0x27, G: 0xae, B: 0x81, A: 0xff},
|
||||
{R: 0x28, G: 0xaf, B: 0x80, A: 0xff},
|
||||
{R: 0x29, G: 0xaf, B: 0x7f, A: 0xff},
|
||||
{R: 0x2a, G: 0xb0, B: 0x7f, A: 0xff},
|
||||
{R: 0x2b, G: 0xb1, B: 0x7e, A: 0xff},
|
||||
{R: 0x2c, G: 0xb2, B: 0x7d, A: 0xff},
|
||||
{R: 0x2e, G: 0xb3, B: 0x7c, A: 0xff},
|
||||
{R: 0x2f, G: 0xb4, B: 0x7c, A: 0xff},
|
||||
{R: 0x30, G: 0xb5, B: 0x7b, A: 0xff},
|
||||
{R: 0x32, G: 0xb6, B: 0x7a, A: 0xff},
|
||||
{R: 0x33, G: 0xb7, B: 0x79, A: 0xff},
|
||||
{R: 0x35, G: 0xb7, B: 0x79, A: 0xff},
|
||||
{R: 0x36, G: 0xb8, B: 0x78, A: 0xff},
|
||||
{R: 0x38, G: 0xb9, B: 0x77, A: 0xff},
|
||||
{R: 0x39, G: 0xba, B: 0x76, A: 0xff},
|
||||
{R: 0x3b, G: 0xbb, B: 0x75, A: 0xff},
|
||||
{R: 0x3d, G: 0xbc, B: 0x74, A: 0xff},
|
||||
{R: 0x3e, G: 0xbd, B: 0x73, A: 0xff},
|
||||
{R: 0x40, G: 0xbe, B: 0x72, A: 0xff},
|
||||
{R: 0x42, G: 0xbe, B: 0x71, A: 0xff},
|
||||
{R: 0x44, G: 0xbf, B: 0x70, A: 0xff},
|
||||
{R: 0x46, G: 0xc0, B: 0x6f, A: 0xff},
|
||||
{R: 0x48, G: 0xc1, B: 0x6e, A: 0xff},
|
||||
{R: 0x49, G: 0xc2, B: 0x6d, A: 0xff},
|
||||
{R: 0x4b, G: 0xc2, B: 0x6c, A: 0xff},
|
||||
{R: 0x4d, G: 0xc3, B: 0x6b, A: 0xff},
|
||||
{R: 0x4f, G: 0xc4, B: 0x6a, A: 0xff},
|
||||
{R: 0x51, G: 0xc5, B: 0x69, A: 0xff},
|
||||
{R: 0x53, G: 0xc6, B: 0x68, A: 0xff},
|
||||
{R: 0x55, G: 0xc6, B: 0x66, A: 0xff},
|
||||
{R: 0x58, G: 0xc7, B: 0x65, A: 0xff},
|
||||
{R: 0x5a, G: 0xc8, B: 0x64, A: 0xff},
|
||||
{R: 0x5c, G: 0xc9, B: 0x63, A: 0xff},
|
||||
{R: 0x5e, G: 0xc9, B: 0x62, A: 0xff},
|
||||
{R: 0x60, G: 0xca, B: 0x60, A: 0xff},
|
||||
{R: 0x62, G: 0xcb, B: 0x5f, A: 0xff},
|
||||
{R: 0x65, G: 0xcc, B: 0x5e, A: 0xff},
|
||||
{R: 0x67, G: 0xcc, B: 0x5c, A: 0xff},
|
||||
{R: 0x69, G: 0xcd, B: 0x5b, A: 0xff},
|
||||
{R: 0x6c, G: 0xce, B: 0x5a, A: 0xff},
|
||||
{R: 0x6e, G: 0xce, B: 0x58, A: 0xff},
|
||||
{R: 0x70, G: 0xcf, B: 0x57, A: 0xff},
|
||||
{R: 0x73, G: 0xd0, B: 0x55, A: 0xff},
|
||||
{R: 0x75, G: 0xd0, B: 0x54, A: 0xff},
|
||||
{R: 0x77, G: 0xd1, B: 0x52, A: 0xff},
|
||||
{R: 0x7a, G: 0xd2, B: 0x51, A: 0xff},
|
||||
{R: 0x7c, G: 0xd2, B: 0x4f, A: 0xff},
|
||||
{R: 0x7f, G: 0xd3, B: 0x4e, A: 0xff},
|
||||
{R: 0x81, G: 0xd4, B: 0x4c, A: 0xff},
|
||||
{R: 0x84, G: 0xd4, B: 0x4b, A: 0xff},
|
||||
{R: 0x86, G: 0xd5, B: 0x49, A: 0xff},
|
||||
{R: 0x89, G: 0xd5, B: 0x48, A: 0xff},
|
||||
{R: 0x8b, G: 0xd6, B: 0x46, A: 0xff},
|
||||
{R: 0x8e, G: 0xd7, B: 0x44, A: 0xff},
|
||||
{R: 0x90, G: 0xd7, B: 0x43, A: 0xff},
|
||||
{R: 0x93, G: 0xd8, B: 0x41, A: 0xff},
|
||||
{R: 0x95, G: 0xd8, B: 0x3f, A: 0xff},
|
||||
{R: 0x98, G: 0xd9, B: 0x3e, A: 0xff},
|
||||
{R: 0x9b, G: 0xd9, B: 0x3c, A: 0xff},
|
||||
{R: 0x9d, G: 0xda, B: 0x3a, A: 0xff},
|
||||
{R: 0xa0, G: 0xda, B: 0x39, A: 0xff},
|
||||
{R: 0xa3, G: 0xdb, B: 0x37, A: 0xff},
|
||||
{R: 0xa5, G: 0xdb, B: 0x35, A: 0xff},
|
||||
{R: 0xa8, G: 0xdc, B: 0x33, A: 0xff},
|
||||
{R: 0xab, G: 0xdc, B: 0x32, A: 0xff},
|
||||
{R: 0xad, G: 0xdd, B: 0x30, A: 0xff},
|
||||
{R: 0xb0, G: 0xdd, B: 0x2e, A: 0xff},
|
||||
{R: 0xb3, G: 0xdd, B: 0x2d, A: 0xff},
|
||||
{R: 0xb5, G: 0xde, B: 0x2b, A: 0xff},
|
||||
{R: 0xb8, G: 0xde, B: 0x29, A: 0xff},
|
||||
{R: 0xbb, G: 0xdf, B: 0x27, A: 0xff},
|
||||
{R: 0xbd, G: 0xdf, B: 0x26, A: 0xff},
|
||||
{R: 0xc0, G: 0xdf, B: 0x24, A: 0xff},
|
||||
{R: 0xc3, G: 0xe0, B: 0x23, A: 0xff},
|
||||
{R: 0xc5, G: 0xe0, B: 0x21, A: 0xff},
|
||||
{R: 0xc8, G: 0xe1, B: 0x20, A: 0xff},
|
||||
{R: 0xcb, G: 0xe1, B: 0x1e, A: 0xff},
|
||||
{R: 0xcd, G: 0xe1, B: 0x1d, A: 0xff},
|
||||
{R: 0xd0, G: 0xe2, B: 0x1c, A: 0xff},
|
||||
{R: 0xd3, G: 0xe2, B: 0x1b, A: 0xff},
|
||||
{R: 0xd5, G: 0xe2, B: 0x1a, A: 0xff},
|
||||
{R: 0xd8, G: 0xe3, B: 0x19, A: 0xff},
|
||||
{R: 0xdb, G: 0xe3, B: 0x18, A: 0xff},
|
||||
{R: 0xdd, G: 0xe3, B: 0x18, A: 0xff},
|
||||
{R: 0xe0, G: 0xe4, B: 0x18, A: 0xff},
|
||||
{R: 0xe2, G: 0xe4, B: 0x18, A: 0xff},
|
||||
{R: 0xe5, G: 0xe4, B: 0x18, A: 0xff},
|
||||
{R: 0xe8, G: 0xe5, B: 0x19, A: 0xff},
|
||||
{R: 0xea, G: 0xe5, B: 0x19, A: 0xff},
|
||||
{R: 0xed, G: 0xe5, B: 0x1a, A: 0xff},
|
||||
{R: 0xef, G: 0xe6, B: 0x1b, A: 0xff},
|
||||
{R: 0xf2, G: 0xe6, B: 0x1c, A: 0xff},
|
||||
{R: 0xf4, G: 0xe6, B: 0x1e, A: 0xff},
|
||||
{R: 0xf7, G: 0xe6, B: 0x1f, A: 0xff},
|
||||
{R: 0xf9, G: 0xe7, B: 0x21, A: 0xff},
|
||||
{R: 0xfb, G: 0xe7, B: 0x23, A: 0xff},
|
||||
{R: 0xfe, G: 0xe7, B: 0x24, A: 0xff},
|
||||
drawing.Color{R: 0x44, G: 0x1, B: 0x54, A: 0xff},
|
||||
drawing.Color{R: 0x44, G: 0x2, B: 0x55, A: 0xff},
|
||||
drawing.Color{R: 0x45, G: 0x3, B: 0x57, A: 0xff},
|
||||
drawing.Color{R: 0x45, G: 0x5, B: 0x58, A: 0xff},
|
||||
drawing.Color{R: 0x45, G: 0x6, B: 0x5a, A: 0xff},
|
||||
drawing.Color{R: 0x46, G: 0x8, B: 0x5b, A: 0xff},
|
||||
drawing.Color{R: 0x46, G: 0x9, B: 0x5d, A: 0xff},
|
||||
drawing.Color{R: 0x46, G: 0xb, B: 0x5e, A: 0xff},
|
||||
drawing.Color{R: 0x46, G: 0xc, B: 0x60, A: 0xff},
|
||||
drawing.Color{R: 0x47, G: 0xe, B: 0x61, A: 0xff},
|
||||
drawing.Color{R: 0x47, G: 0xf, B: 0x62, A: 0xff},
|
||||
drawing.Color{R: 0x47, G: 0x11, B: 0x64, A: 0xff},
|
||||
drawing.Color{R: 0x47, G: 0x12, B: 0x65, A: 0xff},
|
||||
drawing.Color{R: 0x47, G: 0x14, B: 0x66, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x15, B: 0x68, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x16, B: 0x69, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x18, B: 0x6a, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x19, B: 0x6c, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x1a, B: 0x6d, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x1c, B: 0x6e, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x1d, B: 0x6f, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x1e, B: 0x70, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x20, B: 0x71, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x21, B: 0x73, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x22, B: 0x74, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x24, B: 0x75, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x25, B: 0x76, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x26, B: 0x77, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0x27, B: 0x78, A: 0xff},
|
||||
drawing.Color{R: 0x47, G: 0x29, B: 0x79, A: 0xff},
|
||||
drawing.Color{R: 0x47, G: 0x2a, B: 0x79, A: 0xff},
|
||||
drawing.Color{R: 0x47, G: 0x2b, B: 0x7a, A: 0xff},
|
||||
drawing.Color{R: 0x47, G: 0x2c, B: 0x7b, A: 0xff},
|
||||
drawing.Color{R: 0x47, G: 0x2e, B: 0x7c, A: 0xff},
|
||||
drawing.Color{R: 0x46, G: 0x2f, B: 0x7d, A: 0xff},
|
||||
drawing.Color{R: 0x46, G: 0x30, B: 0x7e, A: 0xff},
|
||||
drawing.Color{R: 0x46, G: 0x31, B: 0x7e, A: 0xff},
|
||||
drawing.Color{R: 0x46, G: 0x33, B: 0x7f, A: 0xff},
|
||||
drawing.Color{R: 0x45, G: 0x34, B: 0x80, A: 0xff},
|
||||
drawing.Color{R: 0x45, G: 0x35, B: 0x81, A: 0xff},
|
||||
drawing.Color{R: 0x45, G: 0x36, B: 0x81, A: 0xff},
|
||||
drawing.Color{R: 0x44, G: 0x38, B: 0x82, A: 0xff},
|
||||
drawing.Color{R: 0x44, G: 0x39, B: 0x83, A: 0xff},
|
||||
drawing.Color{R: 0x44, G: 0x3a, B: 0x83, A: 0xff},
|
||||
drawing.Color{R: 0x43, G: 0x3b, B: 0x84, A: 0xff},
|
||||
drawing.Color{R: 0x43, G: 0x3c, B: 0x84, A: 0xff},
|
||||
drawing.Color{R: 0x43, G: 0x3e, B: 0x85, A: 0xff},
|
||||
drawing.Color{R: 0x42, G: 0x3f, B: 0x85, A: 0xff},
|
||||
drawing.Color{R: 0x42, G: 0x40, B: 0x86, A: 0xff},
|
||||
drawing.Color{R: 0x41, G: 0x41, B: 0x86, A: 0xff},
|
||||
drawing.Color{R: 0x41, G: 0x42, B: 0x87, A: 0xff},
|
||||
drawing.Color{R: 0x41, G: 0x43, B: 0x87, A: 0xff},
|
||||
drawing.Color{R: 0x40, G: 0x45, B: 0x88, A: 0xff},
|
||||
drawing.Color{R: 0x40, G: 0x46, B: 0x88, A: 0xff},
|
||||
drawing.Color{R: 0x3f, G: 0x47, B: 0x88, A: 0xff},
|
||||
drawing.Color{R: 0x3f, G: 0x48, B: 0x89, A: 0xff},
|
||||
drawing.Color{R: 0x3e, G: 0x49, B: 0x89, A: 0xff},
|
||||
drawing.Color{R: 0x3e, G: 0x4a, B: 0x89, A: 0xff},
|
||||
drawing.Color{R: 0x3d, G: 0x4b, B: 0x8a, A: 0xff},
|
||||
drawing.Color{R: 0x3d, G: 0x4d, B: 0x8a, A: 0xff},
|
||||
drawing.Color{R: 0x3c, G: 0x4e, B: 0x8a, A: 0xff},
|
||||
drawing.Color{R: 0x3c, G: 0x4f, B: 0x8a, A: 0xff},
|
||||
drawing.Color{R: 0x3b, G: 0x50, B: 0x8b, A: 0xff},
|
||||
drawing.Color{R: 0x3b, G: 0x51, B: 0x8b, A: 0xff},
|
||||
drawing.Color{R: 0x3a, G: 0x52, B: 0x8b, A: 0xff},
|
||||
drawing.Color{R: 0x3a, G: 0x53, B: 0x8b, A: 0xff},
|
||||
drawing.Color{R: 0x39, G: 0x54, B: 0x8c, A: 0xff},
|
||||
drawing.Color{R: 0x39, G: 0x55, B: 0x8c, A: 0xff},
|
||||
drawing.Color{R: 0x38, G: 0x56, B: 0x8c, A: 0xff},
|
||||
drawing.Color{R: 0x38, G: 0x57, B: 0x8c, A: 0xff},
|
||||
drawing.Color{R: 0x37, G: 0x58, B: 0x8c, A: 0xff},
|
||||
drawing.Color{R: 0x37, G: 0x59, B: 0x8c, A: 0xff},
|
||||
drawing.Color{R: 0x36, G: 0x5b, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x36, G: 0x5c, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x35, G: 0x5d, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x35, G: 0x5e, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x34, G: 0x5f, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x34, G: 0x60, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x33, G: 0x61, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x33, G: 0x62, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x33, G: 0x63, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x32, G: 0x64, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x32, G: 0x65, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x31, G: 0x66, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x31, G: 0x67, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x30, G: 0x68, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x30, G: 0x69, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2f, G: 0x6a, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2f, G: 0x6b, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2f, G: 0x6c, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2e, G: 0x6d, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2e, G: 0x6e, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2d, G: 0x6f, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2d, G: 0x70, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2d, G: 0x70, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2c, G: 0x71, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2c, G: 0x72, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2b, G: 0x73, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2b, G: 0x74, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2b, G: 0x75, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2a, G: 0x76, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x2a, G: 0x77, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x29, G: 0x78, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x29, G: 0x79, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x29, G: 0x7a, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x28, G: 0x7b, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x28, G: 0x7c, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x28, G: 0x7d, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x27, G: 0x7e, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x27, G: 0x7f, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x26, G: 0x80, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x26, G: 0x81, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x26, G: 0x82, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x25, G: 0x83, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x25, G: 0x83, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x25, G: 0x84, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x24, G: 0x85, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x24, G: 0x86, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x23, G: 0x87, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x23, G: 0x88, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x23, G: 0x89, B: 0x8e, A: 0xff},
|
||||
drawing.Color{R: 0x22, G: 0x8a, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x22, G: 0x8b, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x22, G: 0x8c, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x21, G: 0x8d, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x21, G: 0x8e, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x21, G: 0x8f, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x20, G: 0x90, B: 0x8d, A: 0xff},
|
||||
drawing.Color{R: 0x20, G: 0x91, B: 0x8c, A: 0xff},
|
||||
drawing.Color{R: 0x20, G: 0x92, B: 0x8c, A: 0xff},
|
||||
drawing.Color{R: 0x20, G: 0x93, B: 0x8c, A: 0xff},
|
||||
drawing.Color{R: 0x1f, G: 0x93, B: 0x8c, A: 0xff},
|
||||
drawing.Color{R: 0x1f, G: 0x94, B: 0x8c, A: 0xff},
|
||||
drawing.Color{R: 0x1f, G: 0x95, B: 0x8b, A: 0xff},
|
||||
drawing.Color{R: 0x1f, G: 0x96, B: 0x8b, A: 0xff},
|
||||
drawing.Color{R: 0x1f, G: 0x97, B: 0x8b, A: 0xff},
|
||||
drawing.Color{R: 0x1e, G: 0x98, B: 0x8b, A: 0xff},
|
||||
drawing.Color{R: 0x1e, G: 0x99, B: 0x8a, A: 0xff},
|
||||
drawing.Color{R: 0x1e, G: 0x9a, B: 0x8a, A: 0xff},
|
||||
drawing.Color{R: 0x1e, G: 0x9b, B: 0x8a, A: 0xff},
|
||||
drawing.Color{R: 0x1e, G: 0x9c, B: 0x89, A: 0xff},
|
||||
drawing.Color{R: 0x1e, G: 0x9d, B: 0x89, A: 0xff},
|
||||
drawing.Color{R: 0x1e, G: 0x9e, B: 0x89, A: 0xff},
|
||||
drawing.Color{R: 0x1e, G: 0x9f, B: 0x88, A: 0xff},
|
||||
drawing.Color{R: 0x1e, G: 0xa0, B: 0x88, A: 0xff},
|
||||
drawing.Color{R: 0x1f, G: 0xa1, B: 0x88, A: 0xff},
|
||||
drawing.Color{R: 0x1f, G: 0xa2, B: 0x87, A: 0xff},
|
||||
drawing.Color{R: 0x1f, G: 0xa3, B: 0x87, A: 0xff},
|
||||
drawing.Color{R: 0x1f, G: 0xa3, B: 0x86, A: 0xff},
|
||||
drawing.Color{R: 0x20, G: 0xa4, B: 0x86, A: 0xff},
|
||||
drawing.Color{R: 0x20, G: 0xa5, B: 0x86, A: 0xff},
|
||||
drawing.Color{R: 0x21, G: 0xa6, B: 0x85, A: 0xff},
|
||||
drawing.Color{R: 0x21, G: 0xa7, B: 0x85, A: 0xff},
|
||||
drawing.Color{R: 0x22, G: 0xa8, B: 0x84, A: 0xff},
|
||||
drawing.Color{R: 0x23, G: 0xa9, B: 0x83, A: 0xff},
|
||||
drawing.Color{R: 0x23, G: 0xaa, B: 0x83, A: 0xff},
|
||||
drawing.Color{R: 0x24, G: 0xab, B: 0x82, A: 0xff},
|
||||
drawing.Color{R: 0x25, G: 0xac, B: 0x82, A: 0xff},
|
||||
drawing.Color{R: 0x26, G: 0xad, B: 0x81, A: 0xff},
|
||||
drawing.Color{R: 0x27, G: 0xae, B: 0x81, A: 0xff},
|
||||
drawing.Color{R: 0x28, G: 0xaf, B: 0x80, A: 0xff},
|
||||
drawing.Color{R: 0x29, G: 0xaf, B: 0x7f, A: 0xff},
|
||||
drawing.Color{R: 0x2a, G: 0xb0, B: 0x7f, A: 0xff},
|
||||
drawing.Color{R: 0x2b, G: 0xb1, B: 0x7e, A: 0xff},
|
||||
drawing.Color{R: 0x2c, G: 0xb2, B: 0x7d, A: 0xff},
|
||||
drawing.Color{R: 0x2e, G: 0xb3, B: 0x7c, A: 0xff},
|
||||
drawing.Color{R: 0x2f, G: 0xb4, B: 0x7c, A: 0xff},
|
||||
drawing.Color{R: 0x30, G: 0xb5, B: 0x7b, A: 0xff},
|
||||
drawing.Color{R: 0x32, G: 0xb6, B: 0x7a, A: 0xff},
|
||||
drawing.Color{R: 0x33, G: 0xb7, B: 0x79, A: 0xff},
|
||||
drawing.Color{R: 0x35, G: 0xb7, B: 0x79, A: 0xff},
|
||||
drawing.Color{R: 0x36, G: 0xb8, B: 0x78, A: 0xff},
|
||||
drawing.Color{R: 0x38, G: 0xb9, B: 0x77, A: 0xff},
|
||||
drawing.Color{R: 0x39, G: 0xba, B: 0x76, A: 0xff},
|
||||
drawing.Color{R: 0x3b, G: 0xbb, B: 0x75, A: 0xff},
|
||||
drawing.Color{R: 0x3d, G: 0xbc, B: 0x74, A: 0xff},
|
||||
drawing.Color{R: 0x3e, G: 0xbd, B: 0x73, A: 0xff},
|
||||
drawing.Color{R: 0x40, G: 0xbe, B: 0x72, A: 0xff},
|
||||
drawing.Color{R: 0x42, G: 0xbe, B: 0x71, A: 0xff},
|
||||
drawing.Color{R: 0x44, G: 0xbf, B: 0x70, A: 0xff},
|
||||
drawing.Color{R: 0x46, G: 0xc0, B: 0x6f, A: 0xff},
|
||||
drawing.Color{R: 0x48, G: 0xc1, B: 0x6e, A: 0xff},
|
||||
drawing.Color{R: 0x49, G: 0xc2, B: 0x6d, A: 0xff},
|
||||
drawing.Color{R: 0x4b, G: 0xc2, B: 0x6c, A: 0xff},
|
||||
drawing.Color{R: 0x4d, G: 0xc3, B: 0x6b, A: 0xff},
|
||||
drawing.Color{R: 0x4f, G: 0xc4, B: 0x6a, A: 0xff},
|
||||
drawing.Color{R: 0x51, G: 0xc5, B: 0x69, A: 0xff},
|
||||
drawing.Color{R: 0x53, G: 0xc6, B: 0x68, A: 0xff},
|
||||
drawing.Color{R: 0x55, G: 0xc6, B: 0x66, A: 0xff},
|
||||
drawing.Color{R: 0x58, G: 0xc7, B: 0x65, A: 0xff},
|
||||
drawing.Color{R: 0x5a, G: 0xc8, B: 0x64, A: 0xff},
|
||||
drawing.Color{R: 0x5c, G: 0xc9, B: 0x63, A: 0xff},
|
||||
drawing.Color{R: 0x5e, G: 0xc9, B: 0x62, A: 0xff},
|
||||
drawing.Color{R: 0x60, G: 0xca, B: 0x60, A: 0xff},
|
||||
drawing.Color{R: 0x62, G: 0xcb, B: 0x5f, A: 0xff},
|
||||
drawing.Color{R: 0x65, G: 0xcc, B: 0x5e, A: 0xff},
|
||||
drawing.Color{R: 0x67, G: 0xcc, B: 0x5c, A: 0xff},
|
||||
drawing.Color{R: 0x69, G: 0xcd, B: 0x5b, A: 0xff},
|
||||
drawing.Color{R: 0x6c, G: 0xce, B: 0x5a, A: 0xff},
|
||||
drawing.Color{R: 0x6e, G: 0xce, B: 0x58, A: 0xff},
|
||||
drawing.Color{R: 0x70, G: 0xcf, B: 0x57, A: 0xff},
|
||||
drawing.Color{R: 0x73, G: 0xd0, B: 0x55, A: 0xff},
|
||||
drawing.Color{R: 0x75, G: 0xd0, B: 0x54, A: 0xff},
|
||||
drawing.Color{R: 0x77, G: 0xd1, B: 0x52, A: 0xff},
|
||||
drawing.Color{R: 0x7a, G: 0xd2, B: 0x51, A: 0xff},
|
||||
drawing.Color{R: 0x7c, G: 0xd2, B: 0x4f, A: 0xff},
|
||||
drawing.Color{R: 0x7f, G: 0xd3, B: 0x4e, A: 0xff},
|
||||
drawing.Color{R: 0x81, G: 0xd4, B: 0x4c, A: 0xff},
|
||||
drawing.Color{R: 0x84, G: 0xd4, B: 0x4b, A: 0xff},
|
||||
drawing.Color{R: 0x86, G: 0xd5, B: 0x49, A: 0xff},
|
||||
drawing.Color{R: 0x89, G: 0xd5, B: 0x48, A: 0xff},
|
||||
drawing.Color{R: 0x8b, G: 0xd6, B: 0x46, A: 0xff},
|
||||
drawing.Color{R: 0x8e, G: 0xd7, B: 0x44, A: 0xff},
|
||||
drawing.Color{R: 0x90, G: 0xd7, B: 0x43, A: 0xff},
|
||||
drawing.Color{R: 0x93, G: 0xd8, B: 0x41, A: 0xff},
|
||||
drawing.Color{R: 0x95, G: 0xd8, B: 0x3f, A: 0xff},
|
||||
drawing.Color{R: 0x98, G: 0xd9, B: 0x3e, A: 0xff},
|
||||
drawing.Color{R: 0x9b, G: 0xd9, B: 0x3c, A: 0xff},
|
||||
drawing.Color{R: 0x9d, G: 0xda, B: 0x3a, A: 0xff},
|
||||
drawing.Color{R: 0xa0, G: 0xda, B: 0x39, A: 0xff},
|
||||
drawing.Color{R: 0xa3, G: 0xdb, B: 0x37, A: 0xff},
|
||||
drawing.Color{R: 0xa5, G: 0xdb, B: 0x35, A: 0xff},
|
||||
drawing.Color{R: 0xa8, G: 0xdc, B: 0x33, A: 0xff},
|
||||
drawing.Color{R: 0xab, G: 0xdc, B: 0x32, A: 0xff},
|
||||
drawing.Color{R: 0xad, G: 0xdd, B: 0x30, A: 0xff},
|
||||
drawing.Color{R: 0xb0, G: 0xdd, B: 0x2e, A: 0xff},
|
||||
drawing.Color{R: 0xb3, G: 0xdd, B: 0x2d, A: 0xff},
|
||||
drawing.Color{R: 0xb5, G: 0xde, B: 0x2b, A: 0xff},
|
||||
drawing.Color{R: 0xb8, G: 0xde, B: 0x29, A: 0xff},
|
||||
drawing.Color{R: 0xbb, G: 0xdf, B: 0x27, A: 0xff},
|
||||
drawing.Color{R: 0xbd, G: 0xdf, B: 0x26, A: 0xff},
|
||||
drawing.Color{R: 0xc0, G: 0xdf, B: 0x24, A: 0xff},
|
||||
drawing.Color{R: 0xc3, G: 0xe0, B: 0x23, A: 0xff},
|
||||
drawing.Color{R: 0xc5, G: 0xe0, B: 0x21, A: 0xff},
|
||||
drawing.Color{R: 0xc8, G: 0xe1, B: 0x20, A: 0xff},
|
||||
drawing.Color{R: 0xcb, G: 0xe1, B: 0x1e, A: 0xff},
|
||||
drawing.Color{R: 0xcd, G: 0xe1, B: 0x1d, A: 0xff},
|
||||
drawing.Color{R: 0xd0, G: 0xe2, B: 0x1c, A: 0xff},
|
||||
drawing.Color{R: 0xd3, G: 0xe2, B: 0x1b, A: 0xff},
|
||||
drawing.Color{R: 0xd5, G: 0xe2, B: 0x1a, A: 0xff},
|
||||
drawing.Color{R: 0xd8, G: 0xe3, B: 0x19, A: 0xff},
|
||||
drawing.Color{R: 0xdb, G: 0xe3, B: 0x18, A: 0xff},
|
||||
drawing.Color{R: 0xdd, G: 0xe3, B: 0x18, A: 0xff},
|
||||
drawing.Color{R: 0xe0, G: 0xe4, B: 0x18, A: 0xff},
|
||||
drawing.Color{R: 0xe2, G: 0xe4, B: 0x18, A: 0xff},
|
||||
drawing.Color{R: 0xe5, G: 0xe4, B: 0x18, A: 0xff},
|
||||
drawing.Color{R: 0xe8, G: 0xe5, B: 0x19, A: 0xff},
|
||||
drawing.Color{R: 0xea, G: 0xe5, B: 0x19, A: 0xff},
|
||||
drawing.Color{R: 0xed, G: 0xe5, B: 0x1a, A: 0xff},
|
||||
drawing.Color{R: 0xef, G: 0xe6, B: 0x1b, A: 0xff},
|
||||
drawing.Color{R: 0xf2, G: 0xe6, B: 0x1c, A: 0xff},
|
||||
drawing.Color{R: 0xf4, G: 0xe6, B: 0x1e, A: 0xff},
|
||||
drawing.Color{R: 0xf7, G: 0xe6, B: 0x1f, A: 0xff},
|
||||
drawing.Color{R: 0xf9, G: 0xe7, B: 0x21, A: 0xff},
|
||||
drawing.Color{R: 0xfb, G: 0xe7, B: 0x23, A: 0xff},
|
||||
drawing.Color{R: 0xfe, G: 0xe7, B: 0x24, A: 0xff},
|
||||
}
|
||||
|
||||
// Viridis creates a color map provider.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue