mirror of
https://github.com/golang/go
synced 2024-11-25 23:37:58 -07:00
image/color: add Plan9Palette and WebSafePalette.
R=r, rsc, andybons CC=andybons, golang-dev https://golang.org/cl/10890045
This commit is contained in:
parent
328ec95878
commit
5e37154077
94
src/pkg/image/color/gen.go
Normal file
94
src/pkg/image/color/gen.go
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
// Copyright 2013 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build ignore
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
// This program generates palette.go. Invoke it as
|
||||||
|
// go run gen.go |gofmt >palette.go
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
fmt.Println("// generated by go run gen.go; DO NOT EDIT")
|
||||||
|
fmt.Println()
|
||||||
|
fmt.Println("package color")
|
||||||
|
fmt.Println()
|
||||||
|
printPlan9()
|
||||||
|
printWebSafe()
|
||||||
|
}
|
||||||
|
|
||||||
|
func printPlan9() {
|
||||||
|
c, lines := [3]int{}, [256]string{}
|
||||||
|
for r, i := 0, 0; r != 4; r++ {
|
||||||
|
for v := 0; v != 4; v, i = v+1, i+16 {
|
||||||
|
for g, j := 0, v-r; g != 4; g++ {
|
||||||
|
for b := 0; b != 4; b, j = b+1, j+1 {
|
||||||
|
den := r
|
||||||
|
if g > den {
|
||||||
|
den = g
|
||||||
|
}
|
||||||
|
if b > den {
|
||||||
|
den = b
|
||||||
|
}
|
||||||
|
if den == 0 {
|
||||||
|
c[0] = 0x11 * v
|
||||||
|
c[1] = 0x11 * v
|
||||||
|
c[2] = 0x11 * v
|
||||||
|
} else {
|
||||||
|
num := 17 * (4*den + v)
|
||||||
|
c[0] = r * num / den
|
||||||
|
c[1] = g * num / den
|
||||||
|
c[2] = b * num / den
|
||||||
|
}
|
||||||
|
lines[i+(j&0x0f)] =
|
||||||
|
fmt.Sprintf("\tRGBA{0x%02x, 0x%02x, 0x%02x, 0xff},", c[0], c[1], c[2])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fmt.Println("// Plan9Palette is a 256-color palette that partitions the 24-bit RGB space")
|
||||||
|
fmt.Println("// into 4×4×4 subdivision, with 4 shades in each subcube. Compared to the")
|
||||||
|
fmt.Println("// WebSafePalette, the idea is to reduce the color resolution by dicing the")
|
||||||
|
fmt.Println("// color cube into fewer cells, and to use the extra space to increase the")
|
||||||
|
fmt.Println("// intensity resolution. This results in 16 gray shades (4 gray subcubes with")
|
||||||
|
fmt.Println("// 4 samples in each), 13 shades of each primary and secondary color (3")
|
||||||
|
fmt.Println("// subcubes with 4 samples plus black) and a reasonable selection of colors")
|
||||||
|
fmt.Println("// covering the rest of the color cube. The advantage is better representation")
|
||||||
|
fmt.Println("// of continuous tones.")
|
||||||
|
fmt.Println("//")
|
||||||
|
fmt.Println("// This palette was used in the Plan 9 Operating System, described at")
|
||||||
|
fmt.Println("// http://plan9.bell-labs.com/magic/man2html/6/color")
|
||||||
|
fmt.Println("var Plan9Palette = []Color{")
|
||||||
|
for _, line := range lines {
|
||||||
|
fmt.Println(line)
|
||||||
|
}
|
||||||
|
fmt.Println("}")
|
||||||
|
fmt.Println()
|
||||||
|
}
|
||||||
|
|
||||||
|
func printWebSafe() {
|
||||||
|
lines := [6 * 6 * 6]string{}
|
||||||
|
for r := 0; r < 6; r++ {
|
||||||
|
for g := 0; g < 6; g++ {
|
||||||
|
for b := 0; b < 6; b++ {
|
||||||
|
lines[36*r+6*g+b] =
|
||||||
|
fmt.Sprintf("\tRGBA{0x%02x, 0x%02x, 0x%02x, 0xff},", 0x33*r, 0x33*g, 0x33*b)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fmt.Println("// WebSafePalette is a 216-color palette that was popularized by early versions")
|
||||||
|
fmt.Println("// of Netscape Navigator. It is also known as the Netscape Color Cube.")
|
||||||
|
fmt.Println("//")
|
||||||
|
fmt.Println("// See http://en.wikipedia.org/wiki/Web_colors#Web-safe_colors for details.")
|
||||||
|
fmt.Println("var WebSafePalette = []Color{")
|
||||||
|
for _, line := range lines {
|
||||||
|
fmt.Println(line)
|
||||||
|
}
|
||||||
|
fmt.Println("}")
|
||||||
|
fmt.Println()
|
||||||
|
}
|
497
src/pkg/image/color/palette.go
Normal file
497
src/pkg/image/color/palette.go
Normal file
@ -0,0 +1,497 @@
|
|||||||
|
// generated by go run gen.go; DO NOT EDIT
|
||||||
|
|
||||||
|
package color
|
||||||
|
|
||||||
|
// Plan9Palette is a 256-color palette that partitions the 24-bit RGB space
|
||||||
|
// into 4×4×4 subdivision, with 4 shades in each subcube. Compared to the
|
||||||
|
// WebSafePalette, the idea is to reduce the color resolution by dicing the
|
||||||
|
// color cube into fewer cells, and to use the extra space to increase the
|
||||||
|
// intensity resolution. This results in 16 gray shades (4 gray subcubes with
|
||||||
|
// 4 samples in each), 13 shades of each primary and secondary color (3
|
||||||
|
// subcubes with 4 samples plus black) and a reasonable selection of colors
|
||||||
|
// covering the rest of the color cube. The advantage is better representation
|
||||||
|
// of continuous tones.
|
||||||
|
//
|
||||||
|
// This palette was used in the Plan 9 Operating System, described at
|
||||||
|
// http://plan9.bell-labs.com/magic/man2html/6/color
|
||||||
|
var Plan9Palette = []Color{
|
||||||
|
RGBA{0x00, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0x44, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0x88, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0xcc, 0xff},
|
||||||
|
RGBA{0x00, 0x44, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0x44, 0x44, 0xff},
|
||||||
|
RGBA{0x00, 0x44, 0x88, 0xff},
|
||||||
|
RGBA{0x00, 0x44, 0xcc, 0xff},
|
||||||
|
RGBA{0x00, 0x88, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0x88, 0x44, 0xff},
|
||||||
|
RGBA{0x00, 0x88, 0x88, 0xff},
|
||||||
|
RGBA{0x00, 0x88, 0xcc, 0xff},
|
||||||
|
RGBA{0x00, 0xcc, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0xcc, 0x44, 0xff},
|
||||||
|
RGBA{0x00, 0xcc, 0x88, 0xff},
|
||||||
|
RGBA{0x00, 0xcc, 0xcc, 0xff},
|
||||||
|
RGBA{0x00, 0xdd, 0xdd, 0xff},
|
||||||
|
RGBA{0x11, 0x11, 0x11, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0x55, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0x99, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0xdd, 0xff},
|
||||||
|
RGBA{0x00, 0x55, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0x55, 0x55, 0xff},
|
||||||
|
RGBA{0x00, 0x4c, 0x99, 0xff},
|
||||||
|
RGBA{0x00, 0x49, 0xdd, 0xff},
|
||||||
|
RGBA{0x00, 0x99, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0x99, 0x4c, 0xff},
|
||||||
|
RGBA{0x00, 0x99, 0x99, 0xff},
|
||||||
|
RGBA{0x00, 0x93, 0xdd, 0xff},
|
||||||
|
RGBA{0x00, 0xdd, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0xdd, 0x49, 0xff},
|
||||||
|
RGBA{0x00, 0xdd, 0x93, 0xff},
|
||||||
|
RGBA{0x00, 0xee, 0x9e, 0xff},
|
||||||
|
RGBA{0x00, 0xee, 0xee, 0xff},
|
||||||
|
RGBA{0x22, 0x22, 0x22, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0x66, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0xaa, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0xee, 0xff},
|
||||||
|
RGBA{0x00, 0x66, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0x66, 0x66, 0xff},
|
||||||
|
RGBA{0x00, 0x55, 0xaa, 0xff},
|
||||||
|
RGBA{0x00, 0x4f, 0xee, 0xff},
|
||||||
|
RGBA{0x00, 0xaa, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0xaa, 0x55, 0xff},
|
||||||
|
RGBA{0x00, 0xaa, 0xaa, 0xff},
|
||||||
|
RGBA{0x00, 0x9e, 0xee, 0xff},
|
||||||
|
RGBA{0x00, 0xee, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0xee, 0x4f, 0xff},
|
||||||
|
RGBA{0x00, 0xff, 0x55, 0xff},
|
||||||
|
RGBA{0x00, 0xff, 0xaa, 0xff},
|
||||||
|
RGBA{0x00, 0xff, 0xff, 0xff},
|
||||||
|
RGBA{0x33, 0x33, 0x33, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0x77, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0xbb, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0xff, 0xff},
|
||||||
|
RGBA{0x00, 0x77, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0x77, 0x77, 0xff},
|
||||||
|
RGBA{0x00, 0x5d, 0xbb, 0xff},
|
||||||
|
RGBA{0x00, 0x55, 0xff, 0xff},
|
||||||
|
RGBA{0x00, 0xbb, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0xbb, 0x5d, 0xff},
|
||||||
|
RGBA{0x00, 0xbb, 0xbb, 0xff},
|
||||||
|
RGBA{0x00, 0xaa, 0xff, 0xff},
|
||||||
|
RGBA{0x00, 0xff, 0x00, 0xff},
|
||||||
|
RGBA{0x44, 0x00, 0x44, 0xff},
|
||||||
|
RGBA{0x44, 0x00, 0x88, 0xff},
|
||||||
|
RGBA{0x44, 0x00, 0xcc, 0xff},
|
||||||
|
RGBA{0x44, 0x44, 0x00, 0xff},
|
||||||
|
RGBA{0x44, 0x44, 0x44, 0xff},
|
||||||
|
RGBA{0x44, 0x44, 0x88, 0xff},
|
||||||
|
RGBA{0x44, 0x44, 0xcc, 0xff},
|
||||||
|
RGBA{0x44, 0x88, 0x00, 0xff},
|
||||||
|
RGBA{0x44, 0x88, 0x44, 0xff},
|
||||||
|
RGBA{0x44, 0x88, 0x88, 0xff},
|
||||||
|
RGBA{0x44, 0x88, 0xcc, 0xff},
|
||||||
|
RGBA{0x44, 0xcc, 0x00, 0xff},
|
||||||
|
RGBA{0x44, 0xcc, 0x44, 0xff},
|
||||||
|
RGBA{0x44, 0xcc, 0x88, 0xff},
|
||||||
|
RGBA{0x44, 0xcc, 0xcc, 0xff},
|
||||||
|
RGBA{0x44, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0x55, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0x55, 0x00, 0x55, 0xff},
|
||||||
|
RGBA{0x4c, 0x00, 0x99, 0xff},
|
||||||
|
RGBA{0x49, 0x00, 0xdd, 0xff},
|
||||||
|
RGBA{0x55, 0x55, 0x00, 0xff},
|
||||||
|
RGBA{0x55, 0x55, 0x55, 0xff},
|
||||||
|
RGBA{0x4c, 0x4c, 0x99, 0xff},
|
||||||
|
RGBA{0x49, 0x49, 0xdd, 0xff},
|
||||||
|
RGBA{0x4c, 0x99, 0x00, 0xff},
|
||||||
|
RGBA{0x4c, 0x99, 0x4c, 0xff},
|
||||||
|
RGBA{0x4c, 0x99, 0x99, 0xff},
|
||||||
|
RGBA{0x49, 0x93, 0xdd, 0xff},
|
||||||
|
RGBA{0x49, 0xdd, 0x00, 0xff},
|
||||||
|
RGBA{0x49, 0xdd, 0x49, 0xff},
|
||||||
|
RGBA{0x49, 0xdd, 0x93, 0xff},
|
||||||
|
RGBA{0x49, 0xdd, 0xdd, 0xff},
|
||||||
|
RGBA{0x4f, 0xee, 0xee, 0xff},
|
||||||
|
RGBA{0x66, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0x66, 0x00, 0x66, 0xff},
|
||||||
|
RGBA{0x55, 0x00, 0xaa, 0xff},
|
||||||
|
RGBA{0x4f, 0x00, 0xee, 0xff},
|
||||||
|
RGBA{0x66, 0x66, 0x00, 0xff},
|
||||||
|
RGBA{0x66, 0x66, 0x66, 0xff},
|
||||||
|
RGBA{0x55, 0x55, 0xaa, 0xff},
|
||||||
|
RGBA{0x4f, 0x4f, 0xee, 0xff},
|
||||||
|
RGBA{0x55, 0xaa, 0x00, 0xff},
|
||||||
|
RGBA{0x55, 0xaa, 0x55, 0xff},
|
||||||
|
RGBA{0x55, 0xaa, 0xaa, 0xff},
|
||||||
|
RGBA{0x4f, 0x9e, 0xee, 0xff},
|
||||||
|
RGBA{0x4f, 0xee, 0x00, 0xff},
|
||||||
|
RGBA{0x4f, 0xee, 0x4f, 0xff},
|
||||||
|
RGBA{0x4f, 0xee, 0x9e, 0xff},
|
||||||
|
RGBA{0x55, 0xff, 0xaa, 0xff},
|
||||||
|
RGBA{0x55, 0xff, 0xff, 0xff},
|
||||||
|
RGBA{0x77, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0x77, 0x00, 0x77, 0xff},
|
||||||
|
RGBA{0x5d, 0x00, 0xbb, 0xff},
|
||||||
|
RGBA{0x55, 0x00, 0xff, 0xff},
|
||||||
|
RGBA{0x77, 0x77, 0x00, 0xff},
|
||||||
|
RGBA{0x77, 0x77, 0x77, 0xff},
|
||||||
|
RGBA{0x5d, 0x5d, 0xbb, 0xff},
|
||||||
|
RGBA{0x55, 0x55, 0xff, 0xff},
|
||||||
|
RGBA{0x5d, 0xbb, 0x00, 0xff},
|
||||||
|
RGBA{0x5d, 0xbb, 0x5d, 0xff},
|
||||||
|
RGBA{0x5d, 0xbb, 0xbb, 0xff},
|
||||||
|
RGBA{0x55, 0xaa, 0xff, 0xff},
|
||||||
|
RGBA{0x55, 0xff, 0x00, 0xff},
|
||||||
|
RGBA{0x55, 0xff, 0x55, 0xff},
|
||||||
|
RGBA{0x88, 0x00, 0x88, 0xff},
|
||||||
|
RGBA{0x88, 0x00, 0xcc, 0xff},
|
||||||
|
RGBA{0x88, 0x44, 0x00, 0xff},
|
||||||
|
RGBA{0x88, 0x44, 0x44, 0xff},
|
||||||
|
RGBA{0x88, 0x44, 0x88, 0xff},
|
||||||
|
RGBA{0x88, 0x44, 0xcc, 0xff},
|
||||||
|
RGBA{0x88, 0x88, 0x00, 0xff},
|
||||||
|
RGBA{0x88, 0x88, 0x44, 0xff},
|
||||||
|
RGBA{0x88, 0x88, 0x88, 0xff},
|
||||||
|
RGBA{0x88, 0x88, 0xcc, 0xff},
|
||||||
|
RGBA{0x88, 0xcc, 0x00, 0xff},
|
||||||
|
RGBA{0x88, 0xcc, 0x44, 0xff},
|
||||||
|
RGBA{0x88, 0xcc, 0x88, 0xff},
|
||||||
|
RGBA{0x88, 0xcc, 0xcc, 0xff},
|
||||||
|
RGBA{0x88, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0x88, 0x00, 0x44, 0xff},
|
||||||
|
RGBA{0x99, 0x00, 0x4c, 0xff},
|
||||||
|
RGBA{0x99, 0x00, 0x99, 0xff},
|
||||||
|
RGBA{0x93, 0x00, 0xdd, 0xff},
|
||||||
|
RGBA{0x99, 0x4c, 0x00, 0xff},
|
||||||
|
RGBA{0x99, 0x4c, 0x4c, 0xff},
|
||||||
|
RGBA{0x99, 0x4c, 0x99, 0xff},
|
||||||
|
RGBA{0x93, 0x49, 0xdd, 0xff},
|
||||||
|
RGBA{0x99, 0x99, 0x00, 0xff},
|
||||||
|
RGBA{0x99, 0x99, 0x4c, 0xff},
|
||||||
|
RGBA{0x99, 0x99, 0x99, 0xff},
|
||||||
|
RGBA{0x93, 0x93, 0xdd, 0xff},
|
||||||
|
RGBA{0x93, 0xdd, 0x00, 0xff},
|
||||||
|
RGBA{0x93, 0xdd, 0x49, 0xff},
|
||||||
|
RGBA{0x93, 0xdd, 0x93, 0xff},
|
||||||
|
RGBA{0x93, 0xdd, 0xdd, 0xff},
|
||||||
|
RGBA{0x99, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0xaa, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0xaa, 0x00, 0x55, 0xff},
|
||||||
|
RGBA{0xaa, 0x00, 0xaa, 0xff},
|
||||||
|
RGBA{0x9e, 0x00, 0xee, 0xff},
|
||||||
|
RGBA{0xaa, 0x55, 0x00, 0xff},
|
||||||
|
RGBA{0xaa, 0x55, 0x55, 0xff},
|
||||||
|
RGBA{0xaa, 0x55, 0xaa, 0xff},
|
||||||
|
RGBA{0x9e, 0x4f, 0xee, 0xff},
|
||||||
|
RGBA{0xaa, 0xaa, 0x00, 0xff},
|
||||||
|
RGBA{0xaa, 0xaa, 0x55, 0xff},
|
||||||
|
RGBA{0xaa, 0xaa, 0xaa, 0xff},
|
||||||
|
RGBA{0x9e, 0x9e, 0xee, 0xff},
|
||||||
|
RGBA{0x9e, 0xee, 0x00, 0xff},
|
||||||
|
RGBA{0x9e, 0xee, 0x4f, 0xff},
|
||||||
|
RGBA{0x9e, 0xee, 0x9e, 0xff},
|
||||||
|
RGBA{0x9e, 0xee, 0xee, 0xff},
|
||||||
|
RGBA{0xaa, 0xff, 0xff, 0xff},
|
||||||
|
RGBA{0xbb, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0xbb, 0x00, 0x5d, 0xff},
|
||||||
|
RGBA{0xbb, 0x00, 0xbb, 0xff},
|
||||||
|
RGBA{0xaa, 0x00, 0xff, 0xff},
|
||||||
|
RGBA{0xbb, 0x5d, 0x00, 0xff},
|
||||||
|
RGBA{0xbb, 0x5d, 0x5d, 0xff},
|
||||||
|
RGBA{0xbb, 0x5d, 0xbb, 0xff},
|
||||||
|
RGBA{0xaa, 0x55, 0xff, 0xff},
|
||||||
|
RGBA{0xbb, 0xbb, 0x00, 0xff},
|
||||||
|
RGBA{0xbb, 0xbb, 0x5d, 0xff},
|
||||||
|
RGBA{0xbb, 0xbb, 0xbb, 0xff},
|
||||||
|
RGBA{0xaa, 0xaa, 0xff, 0xff},
|
||||||
|
RGBA{0xaa, 0xff, 0x00, 0xff},
|
||||||
|
RGBA{0xaa, 0xff, 0x55, 0xff},
|
||||||
|
RGBA{0xaa, 0xff, 0xaa, 0xff},
|
||||||
|
RGBA{0xcc, 0x00, 0xcc, 0xff},
|
||||||
|
RGBA{0xcc, 0x44, 0x00, 0xff},
|
||||||
|
RGBA{0xcc, 0x44, 0x44, 0xff},
|
||||||
|
RGBA{0xcc, 0x44, 0x88, 0xff},
|
||||||
|
RGBA{0xcc, 0x44, 0xcc, 0xff},
|
||||||
|
RGBA{0xcc, 0x88, 0x00, 0xff},
|
||||||
|
RGBA{0xcc, 0x88, 0x44, 0xff},
|
||||||
|
RGBA{0xcc, 0x88, 0x88, 0xff},
|
||||||
|
RGBA{0xcc, 0x88, 0xcc, 0xff},
|
||||||
|
RGBA{0xcc, 0xcc, 0x00, 0xff},
|
||||||
|
RGBA{0xcc, 0xcc, 0x44, 0xff},
|
||||||
|
RGBA{0xcc, 0xcc, 0x88, 0xff},
|
||||||
|
RGBA{0xcc, 0xcc, 0xcc, 0xff},
|
||||||
|
RGBA{0xcc, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0xcc, 0x00, 0x44, 0xff},
|
||||||
|
RGBA{0xcc, 0x00, 0x88, 0xff},
|
||||||
|
RGBA{0xdd, 0x00, 0x93, 0xff},
|
||||||
|
RGBA{0xdd, 0x00, 0xdd, 0xff},
|
||||||
|
RGBA{0xdd, 0x49, 0x00, 0xff},
|
||||||
|
RGBA{0xdd, 0x49, 0x49, 0xff},
|
||||||
|
RGBA{0xdd, 0x49, 0x93, 0xff},
|
||||||
|
RGBA{0xdd, 0x49, 0xdd, 0xff},
|
||||||
|
RGBA{0xdd, 0x93, 0x00, 0xff},
|
||||||
|
RGBA{0xdd, 0x93, 0x49, 0xff},
|
||||||
|
RGBA{0xdd, 0x93, 0x93, 0xff},
|
||||||
|
RGBA{0xdd, 0x93, 0xdd, 0xff},
|
||||||
|
RGBA{0xdd, 0xdd, 0x00, 0xff},
|
||||||
|
RGBA{0xdd, 0xdd, 0x49, 0xff},
|
||||||
|
RGBA{0xdd, 0xdd, 0x93, 0xff},
|
||||||
|
RGBA{0xdd, 0xdd, 0xdd, 0xff},
|
||||||
|
RGBA{0xdd, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0xdd, 0x00, 0x49, 0xff},
|
||||||
|
RGBA{0xee, 0x00, 0x4f, 0xff},
|
||||||
|
RGBA{0xee, 0x00, 0x9e, 0xff},
|
||||||
|
RGBA{0xee, 0x00, 0xee, 0xff},
|
||||||
|
RGBA{0xee, 0x4f, 0x00, 0xff},
|
||||||
|
RGBA{0xee, 0x4f, 0x4f, 0xff},
|
||||||
|
RGBA{0xee, 0x4f, 0x9e, 0xff},
|
||||||
|
RGBA{0xee, 0x4f, 0xee, 0xff},
|
||||||
|
RGBA{0xee, 0x9e, 0x00, 0xff},
|
||||||
|
RGBA{0xee, 0x9e, 0x4f, 0xff},
|
||||||
|
RGBA{0xee, 0x9e, 0x9e, 0xff},
|
||||||
|
RGBA{0xee, 0x9e, 0xee, 0xff},
|
||||||
|
RGBA{0xee, 0xee, 0x00, 0xff},
|
||||||
|
RGBA{0xee, 0xee, 0x4f, 0xff},
|
||||||
|
RGBA{0xee, 0xee, 0x9e, 0xff},
|
||||||
|
RGBA{0xee, 0xee, 0xee, 0xff},
|
||||||
|
RGBA{0xee, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0xff, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0xff, 0x00, 0x55, 0xff},
|
||||||
|
RGBA{0xff, 0x00, 0xaa, 0xff},
|
||||||
|
RGBA{0xff, 0x00, 0xff, 0xff},
|
||||||
|
RGBA{0xff, 0x55, 0x00, 0xff},
|
||||||
|
RGBA{0xff, 0x55, 0x55, 0xff},
|
||||||
|
RGBA{0xff, 0x55, 0xaa, 0xff},
|
||||||
|
RGBA{0xff, 0x55, 0xff, 0xff},
|
||||||
|
RGBA{0xff, 0xaa, 0x00, 0xff},
|
||||||
|
RGBA{0xff, 0xaa, 0x55, 0xff},
|
||||||
|
RGBA{0xff, 0xaa, 0xaa, 0xff},
|
||||||
|
RGBA{0xff, 0xaa, 0xff, 0xff},
|
||||||
|
RGBA{0xff, 0xff, 0x00, 0xff},
|
||||||
|
RGBA{0xff, 0xff, 0x55, 0xff},
|
||||||
|
RGBA{0xff, 0xff, 0xaa, 0xff},
|
||||||
|
RGBA{0xff, 0xff, 0xff, 0xff},
|
||||||
|
}
|
||||||
|
|
||||||
|
// WebSafePalette is a 216-color palette that was popularized by early versions
|
||||||
|
// of Netscape Navigator. It is also known as the Netscape Color Cube.
|
||||||
|
//
|
||||||
|
// See http://en.wikipedia.org/wiki/Web_colors#Web-safe_colors for details.
|
||||||
|
var WebSafePalette = []Color{
|
||||||
|
RGBA{0x00, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0x33, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0x66, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0x99, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0xcc, 0xff},
|
||||||
|
RGBA{0x00, 0x00, 0xff, 0xff},
|
||||||
|
RGBA{0x00, 0x33, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0x33, 0x33, 0xff},
|
||||||
|
RGBA{0x00, 0x33, 0x66, 0xff},
|
||||||
|
RGBA{0x00, 0x33, 0x99, 0xff},
|
||||||
|
RGBA{0x00, 0x33, 0xcc, 0xff},
|
||||||
|
RGBA{0x00, 0x33, 0xff, 0xff},
|
||||||
|
RGBA{0x00, 0x66, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0x66, 0x33, 0xff},
|
||||||
|
RGBA{0x00, 0x66, 0x66, 0xff},
|
||||||
|
RGBA{0x00, 0x66, 0x99, 0xff},
|
||||||
|
RGBA{0x00, 0x66, 0xcc, 0xff},
|
||||||
|
RGBA{0x00, 0x66, 0xff, 0xff},
|
||||||
|
RGBA{0x00, 0x99, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0x99, 0x33, 0xff},
|
||||||
|
RGBA{0x00, 0x99, 0x66, 0xff},
|
||||||
|
RGBA{0x00, 0x99, 0x99, 0xff},
|
||||||
|
RGBA{0x00, 0x99, 0xcc, 0xff},
|
||||||
|
RGBA{0x00, 0x99, 0xff, 0xff},
|
||||||
|
RGBA{0x00, 0xcc, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0xcc, 0x33, 0xff},
|
||||||
|
RGBA{0x00, 0xcc, 0x66, 0xff},
|
||||||
|
RGBA{0x00, 0xcc, 0x99, 0xff},
|
||||||
|
RGBA{0x00, 0xcc, 0xcc, 0xff},
|
||||||
|
RGBA{0x00, 0xcc, 0xff, 0xff},
|
||||||
|
RGBA{0x00, 0xff, 0x00, 0xff},
|
||||||
|
RGBA{0x00, 0xff, 0x33, 0xff},
|
||||||
|
RGBA{0x00, 0xff, 0x66, 0xff},
|
||||||
|
RGBA{0x00, 0xff, 0x99, 0xff},
|
||||||
|
RGBA{0x00, 0xff, 0xcc, 0xff},
|
||||||
|
RGBA{0x00, 0xff, 0xff, 0xff},
|
||||||
|
RGBA{0x33, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0x33, 0x00, 0x33, 0xff},
|
||||||
|
RGBA{0x33, 0x00, 0x66, 0xff},
|
||||||
|
RGBA{0x33, 0x00, 0x99, 0xff},
|
||||||
|
RGBA{0x33, 0x00, 0xcc, 0xff},
|
||||||
|
RGBA{0x33, 0x00, 0xff, 0xff},
|
||||||
|
RGBA{0x33, 0x33, 0x00, 0xff},
|
||||||
|
RGBA{0x33, 0x33, 0x33, 0xff},
|
||||||
|
RGBA{0x33, 0x33, 0x66, 0xff},
|
||||||
|
RGBA{0x33, 0x33, 0x99, 0xff},
|
||||||
|
RGBA{0x33, 0x33, 0xcc, 0xff},
|
||||||
|
RGBA{0x33, 0x33, 0xff, 0xff},
|
||||||
|
RGBA{0x33, 0x66, 0x00, 0xff},
|
||||||
|
RGBA{0x33, 0x66, 0x33, 0xff},
|
||||||
|
RGBA{0x33, 0x66, 0x66, 0xff},
|
||||||
|
RGBA{0x33, 0x66, 0x99, 0xff},
|
||||||
|
RGBA{0x33, 0x66, 0xcc, 0xff},
|
||||||
|
RGBA{0x33, 0x66, 0xff, 0xff},
|
||||||
|
RGBA{0x33, 0x99, 0x00, 0xff},
|
||||||
|
RGBA{0x33, 0x99, 0x33, 0xff},
|
||||||
|
RGBA{0x33, 0x99, 0x66, 0xff},
|
||||||
|
RGBA{0x33, 0x99, 0x99, 0xff},
|
||||||
|
RGBA{0x33, 0x99, 0xcc, 0xff},
|
||||||
|
RGBA{0x33, 0x99, 0xff, 0xff},
|
||||||
|
RGBA{0x33, 0xcc, 0x00, 0xff},
|
||||||
|
RGBA{0x33, 0xcc, 0x33, 0xff},
|
||||||
|
RGBA{0x33, 0xcc, 0x66, 0xff},
|
||||||
|
RGBA{0x33, 0xcc, 0x99, 0xff},
|
||||||
|
RGBA{0x33, 0xcc, 0xcc, 0xff},
|
||||||
|
RGBA{0x33, 0xcc, 0xff, 0xff},
|
||||||
|
RGBA{0x33, 0xff, 0x00, 0xff},
|
||||||
|
RGBA{0x33, 0xff, 0x33, 0xff},
|
||||||
|
RGBA{0x33, 0xff, 0x66, 0xff},
|
||||||
|
RGBA{0x33, 0xff, 0x99, 0xff},
|
||||||
|
RGBA{0x33, 0xff, 0xcc, 0xff},
|
||||||
|
RGBA{0x33, 0xff, 0xff, 0xff},
|
||||||
|
RGBA{0x66, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0x66, 0x00, 0x33, 0xff},
|
||||||
|
RGBA{0x66, 0x00, 0x66, 0xff},
|
||||||
|
RGBA{0x66, 0x00, 0x99, 0xff},
|
||||||
|
RGBA{0x66, 0x00, 0xcc, 0xff},
|
||||||
|
RGBA{0x66, 0x00, 0xff, 0xff},
|
||||||
|
RGBA{0x66, 0x33, 0x00, 0xff},
|
||||||
|
RGBA{0x66, 0x33, 0x33, 0xff},
|
||||||
|
RGBA{0x66, 0x33, 0x66, 0xff},
|
||||||
|
RGBA{0x66, 0x33, 0x99, 0xff},
|
||||||
|
RGBA{0x66, 0x33, 0xcc, 0xff},
|
||||||
|
RGBA{0x66, 0x33, 0xff, 0xff},
|
||||||
|
RGBA{0x66, 0x66, 0x00, 0xff},
|
||||||
|
RGBA{0x66, 0x66, 0x33, 0xff},
|
||||||
|
RGBA{0x66, 0x66, 0x66, 0xff},
|
||||||
|
RGBA{0x66, 0x66, 0x99, 0xff},
|
||||||
|
RGBA{0x66, 0x66, 0xcc, 0xff},
|
||||||
|
RGBA{0x66, 0x66, 0xff, 0xff},
|
||||||
|
RGBA{0x66, 0x99, 0x00, 0xff},
|
||||||
|
RGBA{0x66, 0x99, 0x33, 0xff},
|
||||||
|
RGBA{0x66, 0x99, 0x66, 0xff},
|
||||||
|
RGBA{0x66, 0x99, 0x99, 0xff},
|
||||||
|
RGBA{0x66, 0x99, 0xcc, 0xff},
|
||||||
|
RGBA{0x66, 0x99, 0xff, 0xff},
|
||||||
|
RGBA{0x66, 0xcc, 0x00, 0xff},
|
||||||
|
RGBA{0x66, 0xcc, 0x33, 0xff},
|
||||||
|
RGBA{0x66, 0xcc, 0x66, 0xff},
|
||||||
|
RGBA{0x66, 0xcc, 0x99, 0xff},
|
||||||
|
RGBA{0x66, 0xcc, 0xcc, 0xff},
|
||||||
|
RGBA{0x66, 0xcc, 0xff, 0xff},
|
||||||
|
RGBA{0x66, 0xff, 0x00, 0xff},
|
||||||
|
RGBA{0x66, 0xff, 0x33, 0xff},
|
||||||
|
RGBA{0x66, 0xff, 0x66, 0xff},
|
||||||
|
RGBA{0x66, 0xff, 0x99, 0xff},
|
||||||
|
RGBA{0x66, 0xff, 0xcc, 0xff},
|
||||||
|
RGBA{0x66, 0xff, 0xff, 0xff},
|
||||||
|
RGBA{0x99, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0x99, 0x00, 0x33, 0xff},
|
||||||
|
RGBA{0x99, 0x00, 0x66, 0xff},
|
||||||
|
RGBA{0x99, 0x00, 0x99, 0xff},
|
||||||
|
RGBA{0x99, 0x00, 0xcc, 0xff},
|
||||||
|
RGBA{0x99, 0x00, 0xff, 0xff},
|
||||||
|
RGBA{0x99, 0x33, 0x00, 0xff},
|
||||||
|
RGBA{0x99, 0x33, 0x33, 0xff},
|
||||||
|
RGBA{0x99, 0x33, 0x66, 0xff},
|
||||||
|
RGBA{0x99, 0x33, 0x99, 0xff},
|
||||||
|
RGBA{0x99, 0x33, 0xcc, 0xff},
|
||||||
|
RGBA{0x99, 0x33, 0xff, 0xff},
|
||||||
|
RGBA{0x99, 0x66, 0x00, 0xff},
|
||||||
|
RGBA{0x99, 0x66, 0x33, 0xff},
|
||||||
|
RGBA{0x99, 0x66, 0x66, 0xff},
|
||||||
|
RGBA{0x99, 0x66, 0x99, 0xff},
|
||||||
|
RGBA{0x99, 0x66, 0xcc, 0xff},
|
||||||
|
RGBA{0x99, 0x66, 0xff, 0xff},
|
||||||
|
RGBA{0x99, 0x99, 0x00, 0xff},
|
||||||
|
RGBA{0x99, 0x99, 0x33, 0xff},
|
||||||
|
RGBA{0x99, 0x99, 0x66, 0xff},
|
||||||
|
RGBA{0x99, 0x99, 0x99, 0xff},
|
||||||
|
RGBA{0x99, 0x99, 0xcc, 0xff},
|
||||||
|
RGBA{0x99, 0x99, 0xff, 0xff},
|
||||||
|
RGBA{0x99, 0xcc, 0x00, 0xff},
|
||||||
|
RGBA{0x99, 0xcc, 0x33, 0xff},
|
||||||
|
RGBA{0x99, 0xcc, 0x66, 0xff},
|
||||||
|
RGBA{0x99, 0xcc, 0x99, 0xff},
|
||||||
|
RGBA{0x99, 0xcc, 0xcc, 0xff},
|
||||||
|
RGBA{0x99, 0xcc, 0xff, 0xff},
|
||||||
|
RGBA{0x99, 0xff, 0x00, 0xff},
|
||||||
|
RGBA{0x99, 0xff, 0x33, 0xff},
|
||||||
|
RGBA{0x99, 0xff, 0x66, 0xff},
|
||||||
|
RGBA{0x99, 0xff, 0x99, 0xff},
|
||||||
|
RGBA{0x99, 0xff, 0xcc, 0xff},
|
||||||
|
RGBA{0x99, 0xff, 0xff, 0xff},
|
||||||
|
RGBA{0xcc, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0xcc, 0x00, 0x33, 0xff},
|
||||||
|
RGBA{0xcc, 0x00, 0x66, 0xff},
|
||||||
|
RGBA{0xcc, 0x00, 0x99, 0xff},
|
||||||
|
RGBA{0xcc, 0x00, 0xcc, 0xff},
|
||||||
|
RGBA{0xcc, 0x00, 0xff, 0xff},
|
||||||
|
RGBA{0xcc, 0x33, 0x00, 0xff},
|
||||||
|
RGBA{0xcc, 0x33, 0x33, 0xff},
|
||||||
|
RGBA{0xcc, 0x33, 0x66, 0xff},
|
||||||
|
RGBA{0xcc, 0x33, 0x99, 0xff},
|
||||||
|
RGBA{0xcc, 0x33, 0xcc, 0xff},
|
||||||
|
RGBA{0xcc, 0x33, 0xff, 0xff},
|
||||||
|
RGBA{0xcc, 0x66, 0x00, 0xff},
|
||||||
|
RGBA{0xcc, 0x66, 0x33, 0xff},
|
||||||
|
RGBA{0xcc, 0x66, 0x66, 0xff},
|
||||||
|
RGBA{0xcc, 0x66, 0x99, 0xff},
|
||||||
|
RGBA{0xcc, 0x66, 0xcc, 0xff},
|
||||||
|
RGBA{0xcc, 0x66, 0xff, 0xff},
|
||||||
|
RGBA{0xcc, 0x99, 0x00, 0xff},
|
||||||
|
RGBA{0xcc, 0x99, 0x33, 0xff},
|
||||||
|
RGBA{0xcc, 0x99, 0x66, 0xff},
|
||||||
|
RGBA{0xcc, 0x99, 0x99, 0xff},
|
||||||
|
RGBA{0xcc, 0x99, 0xcc, 0xff},
|
||||||
|
RGBA{0xcc, 0x99, 0xff, 0xff},
|
||||||
|
RGBA{0xcc, 0xcc, 0x00, 0xff},
|
||||||
|
RGBA{0xcc, 0xcc, 0x33, 0xff},
|
||||||
|
RGBA{0xcc, 0xcc, 0x66, 0xff},
|
||||||
|
RGBA{0xcc, 0xcc, 0x99, 0xff},
|
||||||
|
RGBA{0xcc, 0xcc, 0xcc, 0xff},
|
||||||
|
RGBA{0xcc, 0xcc, 0xff, 0xff},
|
||||||
|
RGBA{0xcc, 0xff, 0x00, 0xff},
|
||||||
|
RGBA{0xcc, 0xff, 0x33, 0xff},
|
||||||
|
RGBA{0xcc, 0xff, 0x66, 0xff},
|
||||||
|
RGBA{0xcc, 0xff, 0x99, 0xff},
|
||||||
|
RGBA{0xcc, 0xff, 0xcc, 0xff},
|
||||||
|
RGBA{0xcc, 0xff, 0xff, 0xff},
|
||||||
|
RGBA{0xff, 0x00, 0x00, 0xff},
|
||||||
|
RGBA{0xff, 0x00, 0x33, 0xff},
|
||||||
|
RGBA{0xff, 0x00, 0x66, 0xff},
|
||||||
|
RGBA{0xff, 0x00, 0x99, 0xff},
|
||||||
|
RGBA{0xff, 0x00, 0xcc, 0xff},
|
||||||
|
RGBA{0xff, 0x00, 0xff, 0xff},
|
||||||
|
RGBA{0xff, 0x33, 0x00, 0xff},
|
||||||
|
RGBA{0xff, 0x33, 0x33, 0xff},
|
||||||
|
RGBA{0xff, 0x33, 0x66, 0xff},
|
||||||
|
RGBA{0xff, 0x33, 0x99, 0xff},
|
||||||
|
RGBA{0xff, 0x33, 0xcc, 0xff},
|
||||||
|
RGBA{0xff, 0x33, 0xff, 0xff},
|
||||||
|
RGBA{0xff, 0x66, 0x00, 0xff},
|
||||||
|
RGBA{0xff, 0x66, 0x33, 0xff},
|
||||||
|
RGBA{0xff, 0x66, 0x66, 0xff},
|
||||||
|
RGBA{0xff, 0x66, 0x99, 0xff},
|
||||||
|
RGBA{0xff, 0x66, 0xcc, 0xff},
|
||||||
|
RGBA{0xff, 0x66, 0xff, 0xff},
|
||||||
|
RGBA{0xff, 0x99, 0x00, 0xff},
|
||||||
|
RGBA{0xff, 0x99, 0x33, 0xff},
|
||||||
|
RGBA{0xff, 0x99, 0x66, 0xff},
|
||||||
|
RGBA{0xff, 0x99, 0x99, 0xff},
|
||||||
|
RGBA{0xff, 0x99, 0xcc, 0xff},
|
||||||
|
RGBA{0xff, 0x99, 0xff, 0xff},
|
||||||
|
RGBA{0xff, 0xcc, 0x00, 0xff},
|
||||||
|
RGBA{0xff, 0xcc, 0x33, 0xff},
|
||||||
|
RGBA{0xff, 0xcc, 0x66, 0xff},
|
||||||
|
RGBA{0xff, 0xcc, 0x99, 0xff},
|
||||||
|
RGBA{0xff, 0xcc, 0xcc, 0xff},
|
||||||
|
RGBA{0xff, 0xcc, 0xff, 0xff},
|
||||||
|
RGBA{0xff, 0xff, 0x00, 0xff},
|
||||||
|
RGBA{0xff, 0xff, 0x33, 0xff},
|
||||||
|
RGBA{0xff, 0xff, 0x66, 0xff},
|
||||||
|
RGBA{0xff, 0xff, 0x99, 0xff},
|
||||||
|
RGBA{0xff, 0xff, 0xcc, 0xff},
|
||||||
|
RGBA{0xff, 0xff, 0xff, 0xff},
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user