Skip to content

plotter: BarChart draws semi-transparent colors grey #550

@gaboose

Description

@gaboose

What are you trying to do?

Set a semi-transparent color to a barchart.

What did you do?

func main() {
	p, _ := plot.New()
	rand.Seed(int64(0))
	v := make(plotter.Values, 20)
	for i := range v {
		v[i] = float64(rand.Intn(20))
	}
	barChart, _ := plotter.NewBarChart(v, 8)
	barChart.Color = color.RGBA{R: 255, G: 255, B: 0, A: 128}
	p.Add(barChart)
	p.Save(4*vg.Inch, 4*vg.Inch, "out.png")
}

What did you expect to happen?

Yellow bars like this to be produced, only a little less bright:
out

What actually happened?

Grey bars:
out

What version of Go and Gonum/plot are you using?

go version go1.12.2 linux/amd64
$ echo (cd (go env GOPATH)/src/gonum.org/v1/plot; and git rev-parse HEAD)
3a5f52653745fa15b552c97e1d8052e496e85503

Does this issue reproduce with the current master?

3a5f52653745fa15b552c97e1d8052e496e85503 is master

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions