Skip to content

Commit

Permalink
fix(ansi): sixel: rename AddTransparent to NoTransparency
Browse files Browse the repository at this point in the history
Should be enabled by default and name should reflect that.
  • Loading branch information
aymanbagabas committed Feb 20, 2025
1 parent 7e1ab01 commit d3ee822
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ansi/sixel/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ type Encoder struct {
// Quantizer is the color quantizer to use. The default is median cut.
Quantizer draw.Quantizer

// AddTransparent is a flag that indicates whether to add a transparent
// color to the palette. The default is false.
AddTransparent bool
// NoTransparency is a flag that indicates whether to not add a transparent
// color to the palette.
NoTransparency bool

// TransparentColor is the color to use for the transparent color in the
// palette. If nil, [color.Transparent] will be used.
Expand Down Expand Up @@ -85,7 +85,7 @@ func (e *Encoder) Encode(w io.Writer, img image.Image) error {

// Make sure we have a transparent color in the palette.
palette := color.Palette(make([]color.Color, 0, nc)) // preallocate one space for transparency
if !e.AddTransparent {
if !e.NoTransparency {
c := e.TransparentColor
if c == nil {
c = color.Transparent
Expand Down

0 comments on commit d3ee822

Please sign in to comment.