Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF0000"))
ErrStyle is the style of the error message
Functions ¶
func New ¶
func New(fz *recfz.FlipperZero, screenUpdate <-chan ScreenMsg, opts ...FlipperOpts) tea.Model
New constructs a new flipper model.
func UpdateScreen ¶
func UpdateScreen(updates chan<- ScreenMsg) func(frame flipper.ScreenFrame)
UpdateScreen renders the terminal screen based on the flipper screen. It also returns the flipper screen as an image. This function is intended to be used as a callback for the flipper.
Types ¶
type FlipperOpts ¶ added in v0.6.1
type FlipperOpts func(*Model)
FlipperOpts represents an optional configuration for the flipper model.
func WithBgColor ¶ added in v0.6.1
func WithBgColor(color string) FlipperOpts
WithBgColor sets the background color of the flipper screen.
func WithFgColor ¶ added in v0.6.1
func WithFgColor(color string) FlipperOpts
WithFgColor sets the foreground color of the flipper screen.
func WithScreenshotResolution ¶ added in v0.6.1
func WithScreenshotResolution(width, height int) FlipperOpts
WithScreenshotResolution sets the resolution of the screenshot.
type Model ¶
type Model struct { // Style is the style of the flipper screen Style lipgloss.Style // contains filtered or unexported fields }
Model represents the flipper model. It also implements the bubbletea.Model interface.
func (Model) Init ¶
Init is the bubbletea init function. the initial listenScreenUpdate command is started here.