Documentation
¶
Overview ¶
Package colorpicker is the magnifier-loupe color picker (crates/lys-shell/src/shell/color_picker): a frozen-frame layer surface per monitor with a zoom loupe that follows the pointer - the magnified pixels around it, a crosshair on the exact pixel a click picks, a hex readout, and a row of recently picked swatches. A click samples that pixel; Escape cancels. The screenshot host captures the frames and hands them over (it owns the capture path), and the portal's Screenshot.PickColor reaches it over dev.stubbe.lys.Screenshot1.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HistoryPath ¶
func HistoryPath() string
HistoryPath is the persisted swatch file: $XDG_DATA_HOME/lys-shell/color-history, else ~/.local/share/lys-shell/color-history. Empty when neither is an absolute path.
Types ¶
type Picker ¶
type Picker struct {
// contains filtered or unexported fields
}
Picker is the picker component. Request is its entry point; the rest runs on the lys-ui loop goroutine.
func New ¶
func New(a *app.Application, gate *regionoverlay.Gate, outputs func() []*app.Output, font render.Font, historyPath string) *Picker
New builds the picker. gate is the shell's one capture gate; font is the readout's monospace bold face; the history loads from historyPath (HistoryPath for the real one).
func (*Picker) Request ¶
Request opens the picker over the frozen frames (keyed by connector), which frames captures once the gate admits the request, and blocks until a click picks a pixel (ok), or the user cancels or ctx ends (not ok, no error). A monitor without a frame gets no surface; when no frame matches any monitor there is nothing to pick from, and that is an error naming both, not a cancel. While another session holds the gate the request opens nothing, takes no frames and answers regionoverlay.ErrBusy. Call it from any goroutine but the loop's.