diff options
| author | nnyyxxxx <nnyyxxxx@protonmail.com> | 2025-03-06 17:24:44 -0500 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-03-22 23:14:51 -0700 |
| commit | 7210045b2a058c4be7bef6fd2059f337bf53b1ec (patch) | |
| tree | ac80aff269a65c16b49e95fb164aef91c3547af8 /niri-ipc | |
| parent | ed20822ce947198e4106698d7afffd0a832a7b3c (diff) | |
| download | niri-7210045b2a058c4be7bef6fd2059f337bf53b1ec.tar.gz niri-7210045b2a058c4be7bef6fd2059f337bf53b1ec.tar.bz2 niri-7210045b2a058c4be7bef6fd2059f337bf53b1ec.zip | |
feat: support color picker functionality
chore: format code
refactor: improve quality
feat: implement gnomes PickColor method
refactor: minor code extraction
misc: fix reviews
fixes
Diffstat (limited to 'niri-ipc')
| -rw-r--r-- | niri-ipc/src/lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/niri-ipc/src/lib.rs b/niri-ipc/src/lib.rs index 33de3d32..591c1bf6 100644 --- a/niri-ipc/src/lib.rs +++ b/niri-ipc/src/lib.rs @@ -65,6 +65,8 @@ pub enum Request { FocusedWindow, /// Request picking a window and get its information. PickWindow, + /// Request picking a color from the screen. + PickColor, /// Perform an action. Action(Action), /// Change output configuration temporarily. @@ -133,10 +135,20 @@ pub enum Response { FocusedWindow(Option<Window>), /// Information about the picked window. PickedWindow(Option<Window>), + /// Information about the picked color. + PickedColor(Option<PickedColor>), /// Output configuration change result. OutputConfigChanged(OutputConfigChanged), } +/// Color picked from the screen. +#[derive(Serialize, Deserialize, Debug, Clone)] +#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))] +pub struct PickedColor { + /// Color values as red, green, blue, each ranging from 0.0 to 1.0. + pub rgb: [f64; 3], +} + /// Actions that niri can perform. // Variants in this enum should match the spelling of the ones in niri-config. Most, but not all, // variants from niri-config should be present here. |
