MCPcopy Create free account
hub / github.com/tdewolff/canvas / TestCSSColor

Function TestCSSColor

util_test.go:124–129  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

122}
123
124func TestCSSColor(t *testing.T) {
125 test.String(t, CSSColor(Cyan).String(), "#0ff")
126 test.String(t, CSSColor(Aliceblue).String(), "#f0f8ff")
127 test.String(t, CSSColor(color.RGBA{255, 255, 255, 0}).String(), "rgba(0,0,0,0)")
128 test.String(t, CSSColor(color.RGBA{85, 85, 17, 85}).String(), "rgba(255,255,51,.33333333)")
129}
130
131func TestToFromFixed(t *testing.T) {
132 test.T(t, fromP26_6(toP26_6(Point{3.0, 5.0})), Point{3.0, 5.0})

Callers

nothing calls this directly

Calls 2

CSSColorTypeAlias · 0.85
StringMethod · 0.45

Tested by

no test coverage detected