Real-image posters: draw placeholder cells on the panes' background color
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/gdamore/tcell/v2"
|
||||
"github.com/rivo/tview"
|
||||
)
|
||||
|
||||
// The Kitty graphics protocol with Unicode placeholders, as supported by
|
||||
@@ -139,7 +140,9 @@ func (k *kittyGraphics) deleteAll() {
|
||||
func placeholderCell(id uint32, row, col int) (main rune, comb []rune, style tcell.Style) {
|
||||
comb = []rune{kittyDiacritics[row], kittyDiacritics[col]}
|
||||
fg := tcell.NewRGBColor(int32(id>>16&0xFF), int32(id>>8&0xFF), int32(id&0xFF))
|
||||
return placeholderRune, comb, tcell.StyleDefault.Foreground(fg)
|
||||
// The background shows wherever the picture does not cover the cell (a
|
||||
// sliver at the edge): use the panes' own color so it is not visible.
|
||||
return placeholderRune, comb, tcell.StyleDefault.Foreground(fg).Background(tview.Styles.PrimitiveBackgroundColor)
|
||||
}
|
||||
|
||||
// maxPlaceholders is how many rows and columns can be numbered.
|
||||
|
||||
Reference in New Issue
Block a user