add a
/ alpha component to json color mapping export
This commit is contained in:
parent
f266593f9a
commit
a7b5226fd1
@ -9,6 +9,7 @@ type Color struct {
|
|||||||
R uint8 `json:"r"`
|
R uint8 `json:"r"`
|
||||||
G uint8 `json:"g"`
|
G uint8 `json:"g"`
|
||||||
B uint8 `json:"b"`
|
B uint8 `json:"b"`
|
||||||
|
A uint8 `json:"a"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (api *Api) GetColorMapping(resp http.ResponseWriter, req *http.Request) {
|
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)
|
cm := make(map[string]Color)
|
||||||
|
|
||||||
for k, v := range api.Context.Colormapping.GetColors() {
|
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")
|
resp.Header().Add("content-type", "application/json")
|
||||||
|
Loading…
Reference in New Issue
Block a user