package ansi

// Rgb represents an RGB colour value
// with 8bits per channel
type Rgb struct {
	R uint8 `json:"r"`
	G uint8 `json:"g"`
	B uint8 `json:"b"`
}

// Hsl represents the HSL value of the colour
type Hsl struct {
	H float64 `json:"h"`
	S float64 `json:"s"`
	L float64 `json:"l"`
}

// Col represents a colour value.
// The Id is the ANSI colour ID.
type Col struct {
    Id      int    `json:"id"`
	Hex     string `json:"hex"`
	Rgb     Rgb    `json:"rgb"`
	Hsl     Hsl    `json:"hsl"`
	Name    string `json:"name"`
}

// Cols represents the default colour definitions
// used by the library. This may be overridden.
var Cols = []*Col{ {{range $col := .}}
    {
        Id:   {{.Id}},
        Hex:  "{{.Hex}}",
        Rgb:  Rgb{ {{.Rgb.R}}, {{.Rgb.G}}, {{.Rgb.B}} },
        Hsl:  Hsl{ {{.Hsl.H}}, {{.Hsl.S}}, {{.Hsl.L}} },
        Name: "{{.Name}}",
    },{{end}}
}
