diff --git a/src/cli/cli.rs b/src/cli/cli.rs index b0cccda..df68c6e 100644 --- a/src/cli/cli.rs +++ b/src/cli/cli.rs @@ -359,7 +359,8 @@ pub fn build_cli() -> Command<'static> { "lab-a", "lab-b", "oklab-l", "oklab-a", "oklab-b", "red", "green", "blue", - "hsl-hue", "hsl-saturation", "hsl-lightness"]) + "hsl-hue", "hsl-saturation", "hsl-lightness", + "alpha"]) .ignore_case(true) .required(true), ) diff --git a/src/cli/commands/color_commands.rs b/src/cli/commands/color_commands.rs index f215fa2..3f6e7c0 100644 --- a/src/cli/commands/color_commands.rs +++ b/src/cli/commands/color_commands.rs @@ -181,6 +181,11 @@ color_command!(SetCommand, config, matches, color, { } Color::from_lch(lch.l, lch.c, lch.h, lch.alpha) } + "alpha" => { + let mut hsla = color.to_hsla(); + hsla.alpha = value; + Color::from_hsla(hsla.h, hsla.s, hsla.l, hsla.alpha) + } &_ => { unreachable!("Unknown property"); }