diff --git a/ansi/sixel/color.go b/ansi/sixel/color.go index 07bbdab5..2f00ce25 100644 --- a/ansi/sixel/color.go +++ b/ansi/sixel/color.go @@ -32,6 +32,10 @@ func ConvertChannel(c uint32) uint32 { // FromColor returns a Sixel color from a color.Color. It converts the color // channels to the 0-100 range. func FromColor(c color.Color) Color { + if c == nil { + return Color{} + } + r, g, b, _ := c.RGBA() return Color{ Pu: 2, // Always use RGB format "2"