summaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/shared.rs
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-11-02 11:46:06 +0100
committerGitHub <noreply@github.com>2021-11-02 11:46:06 +0100
commit070de7a4d14e5670e1d143bfecfe4daf49e0a78f (patch)
treebc3f90bf7d5a57d92f6caf678c80fa80f72a4aa0 /zellij-utils/src/shared.rs
parent7e9dc406bc6eee70e40f97d57c874b89d1d01f30 (diff)
Fix: move `colors_transform` to `colorsys` (#832)
* `colors_transform` is deprecated and superceded by `colorsys` ref: https://crates.io/crates/colors-transform
Diffstat (limited to 'zellij-utils/src/shared.rs')
-rw-r--r--zellij-utils/src/shared.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/zellij-utils/src/shared.rs b/zellij-utils/src/shared.rs
index 06d1378db..37dfc3be2 100644
--- a/zellij-utils/src/shared.rs
+++ b/zellij-utils/src/shared.rs
@@ -2,7 +2,7 @@
use std::{iter, str::from_utf8};
-use colors_transform::{Color, Rgb};
+use colorsys::Rgb;
use std::os::unix::fs::PermissionsExt;
use std::path::Path;
use std::{fs, io};
@@ -52,10 +52,9 @@ pub mod colors {
}
pub fn _hex_to_rgb(hex: &str) -> (u8, u8, u8) {
- let rgb = Rgb::from_hex_str(hex)
+ Rgb::from_hex_str(hex)
.expect("The passed argument must be a valid hex color")
- .as_tuple();
- (rgb.0 as u8, rgb.1 as u8, rgb.2 as u8)
+ .into()
}
pub fn default_palette() -> Palette {