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 variable is set.
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, outputs func() []*app.Output, font render.Font, historyPath string) *Picker
New builds the picker. font is the readout's monospace bold face; the history loads from historyPath (HistoryPath for the real one).
func (*Picker) Cancel ¶
func (p *Picker) Cancel()
Cancel answers the open request, if any, as cancelled and takes the surfaces down. Call it from any goroutine but the loop's.
func (*Picker) Request ¶
Request opens the picker over the frozen frames (keyed by connector) and blocks until a click picks a pixel (ok) or the user cancels. 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. Call it from any goroutine but the loop's.