diff -pruN 0.1.2-2/colorparser.go 0.1.3-1/colorparser.go
--- 0.1.2-2/colorparser.go	2022-06-08 13:23:30.000000000 +0000
+++ 0.1.3-1/colorparser.go	2022-07-29 18:18:19.000000000 +0000
@@ -17,19 +17,19 @@ type Color struct {
 
 // Implement the Go color.Color interface.
 func (c Color) RGBA() (r, g, b, a uint32) {
-	r = uint32(math.Round(c.R * c.A * 65535))
-	g = uint32(math.Round(c.G * c.A * 65535))
-	b = uint32(math.Round(c.B * c.A * 65535))
-	a = uint32(math.Round(c.A * 65535))
+	r = uint32(c.R*c.A*65535 + 0.5)
+	g = uint32(c.G*c.A*65535 + 0.5)
+	b = uint32(c.B*c.A*65535 + 0.5)
+	a = uint32(c.A*65535 + 0.5)
 	return
 }
 
 // RGBA255 returns R, G, B, A values in the range 0..255
 func (c Color) RGBA255() (r, g, b, a uint8) {
-	r = uint8(math.Round(c.R * 255))
-	g = uint8(math.Round(c.G * 255))
-	b = uint8(math.Round(c.B * 255))
-	a = uint8(math.Round(c.A * 255))
+	r = uint8(c.R*255 + 0.5)
+	g = uint8(c.G*255 + 0.5)
+	b = uint8(c.B*255 + 0.5)
+	a = uint8(c.A*255 + 0.5)
 	return
 }
 
@@ -51,6 +51,36 @@ func (c Color) RGBString() string {
 	return fmt.Sprintf("rgb(%d,%d,%d)", r, g, b)
 }
 
+// Name returns name of this color if its available.
+func (c Color) Name() (string, bool) {
+	r, g, b, _ := c.RGBA255()
+	rgb := [3]uint8{r, g, b}
+	for k, v := range namedColors {
+		if v == rgb {
+			return k, true
+		}
+	}
+	return "", false
+}
+
+// Implement the Go TextUnmarshaler interface
+func (c *Color) UnmarshalText(text []byte) error {
+	col, err := Parse(string(text))
+	if err != nil {
+		return err
+	}
+	c.R = col.R
+	c.G = col.G
+	c.B = col.B
+	c.A = col.A
+	return nil
+}
+
+// Implement the Go TextMarshaler interface
+func (c Color) MarshalText() ([]byte, error) {
+	return []byte(c.HexString()), nil
+}
+
 var black = Color{0, 0, 0, 1}
 
 // Parse parses CSS color string and returns, if successful, a Color.
diff -pruN 0.1.2-2/colorparser_test.go 0.1.3-1/colorparser_test.go
--- 0.1.2-2/colorparser_test.go	2022-06-08 13:23:30.000000000 +0000
+++ 0.1.3-1/colorparser_test.go	2022-07-29 18:18:19.000000000 +0000
@@ -2,6 +2,7 @@ package csscolorparser
 
 import (
 	"image/color"
+	"strings"
 	"testing"
 )
 
@@ -70,6 +71,25 @@ func TestParseColor(t *testing.T) {
 }
 
 func TestNamedColors(t *testing.T) {
+	for name, rgb := range namedColors {
+		c, _ := Parse(name)
+		r, g, b, _ := c.RGBA255()
+		rgb_ := [3]uint8{r, g, b}
+		if rgb_ != rgb {
+			t.Errorf("%s != %s", rgb_, rgb)
+		}
+		if name == "aqua" || name == "cyan" || name == "fuchsia" || name == "magenta" {
+			continue
+		}
+		if strings.Contains(name, "gray") || strings.Contains(name, "grey") {
+			continue
+		}
+		name_, _ := c.Name()
+		if name_ != name {
+			t.Errorf("%s != %s", name_, name)
+		}
+	}
+
 	data := [][2]string{
 		{"aliceblue", "#f0f8ff"},
 		{"bisque", "#ffe4c4"},
diff -pruN 0.1.2-2/debian/changelog 0.1.3-1/debian/changelog
--- 0.1.2-2/debian/changelog	2022-06-11 15:00:24.000000000 +0000
+++ 0.1.3-1/debian/changelog	2022-08-03 02:45:22.000000000 +0000
@@ -1,3 +1,10 @@
+golang-github-mazznoer-csscolorparser (0.1.3-1) unstable; urgency=medium
+
+  * Team upload.
+  * New upstream version 0.1.3
+
+ -- tony mancill <tmancill@debian.org>  Tue, 02 Aug 2022 19:45:22 -0700
+
 golang-github-mazznoer-csscolorparser (0.1.2-2) unstable; urgency=medium
 
   * Team upload.
