Skip to content

Commit

Permalink
add a / alpha component to json color mapping export
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Aug 11, 2024
1 parent f266593 commit a7b5226
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/colormapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ 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) {

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")
Expand Down

0 comments on commit a7b5226

Please sign in to comment.