mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Add impl From<Color> for Gradient
This commit is contained in:
@@ -530,6 +530,18 @@ pub struct Gradient {
|
||||
pub in_: GradientInterpolation,
|
||||
}
|
||||
|
||||
impl From<Color> for Gradient {
|
||||
fn from(value: Color) -> Self {
|
||||
Self {
|
||||
from: value,
|
||||
to: value,
|
||||
angle: 0,
|
||||
relative_to: GradientRelativeTo::Window,
|
||||
in_: GradientInterpolation::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(knuffel::DecodeScalar, Debug, Default, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum GradientRelativeTo {
|
||||
#[default]
|
||||
|
||||
Reference in New Issue
Block a user