Debian Codegraph @

shiny/materialdesign/colornames/colornames_test.go

raw symbols SCIP
1 // Copyright 2015 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package colornames
6
7 import (
8 "image/color"
9 "testing"
10 )
11
12 func TestColornames(t *testing.T) {
13 if len(Map) != len(Names) {
14 t.Fatalf("Map and Names have different length: %d vs %d", len(Map), len(Names))
15 }
16
17 for name, want := range testCases {
18 got, ok := Map[name]
19 if !ok {
20 t.Errorf("Did not find %s", name)
21 continue
22 }
23 if got != want {
24 t.Errorf("%s:\ngot %x\nwant %x", name, got, want)
25 }
26 }
27 }
28
29 var testCases = map[string]color.RGBA{
30 "Red500": color.RGBA{0xf4, 0x43, 0x36, 0xff},
31 "Red50": color.RGBA{0xff, 0xeb, 0xee, 0xff},
32 "Red900": color.RGBA{0xb7, 0x1c, 0x1c, 0xff},
33 "RedA700": color.RGBA{0xd5, 0x00, 0x00, 0xff},
34 "Pink300": color.RGBA{0xf0, 0x62, 0x92, 0xff},
35 "Purple100": color.RGBA{0xe1, 0xbe, 0xe7, 0xff},
36 "Cyan400": color.RGBA{0x26, 0xc6, 0xda, 0xff},
37 "LightGreen800": color.RGBA{0x55, 0x8b, 0x2f, 0xff},
38 "DeepOrangeA200": color.RGBA{0xff, 0x6e, 0x40, 0xff},
39 "Brown50": color.RGBA{0xef, 0xeb, 0xe9, 0xff},
40 "Grey500": color.RGBA{0x9e, 0x9e, 0x9e, 0xff},
41 "Grey600": color.RGBA{0x75, 0x75, 0x75, 0xff},
42 "Grey700": color.RGBA{0x61, 0x61, 0x61, 0xff},
43 "BlueGrey400": color.RGBA{0x78, 0x90, 0x9c, 0xff},
44 "Black": color.RGBA{0x00, 0x00, 0x00, 0xff},
45 "White": color.RGBA{0xff, 0xff, 0xff, 0xff},
46 }