From a7b5226fd16c1958a622fee44e1096bf8bfd7d9c Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sun, 11 Aug 2024 13:44:11 +0200 Subject: [PATCH] add `a` / alpha component to json color mapping export --- web/colormapping.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/colormapping.go b/web/colormapping.go index 476239c..4cd8c6f 100644 --- a/web/colormapping.go +++ b/web/colormapping.go @@ -9,6 +9,7 @@ type Color struct { R uint8 `json:"r"` G uint8 `json:"g"` B uint8 `json:"b"` + A uint8 `json:"a"` } func (api *Api) GetColorMapping(resp http.ResponseWriter, req *http.Request) { @@ -16,7 +17,7 @@ func (api *Api) GetColorMapping(resp http.ResponseWriter, req *http.Request) { cm := make(map[string]Color) for k, v := range api.Context.Colormapping.GetColors() { - cm[k] = Color{R: v.R, G: v.G, B: v.B} + cm[k] = Color{R: v.R, G: v.G, B: v.B, A: v.A} } resp.Header().Add("content-type", "application/json")