aboutsummaryrefslogtreecommitdiffstats
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
parentdocs(changelog): forkpty => openpty (diff)
downloadsl0ppij-070de7a4d14e5670e1d143bfecfe4daf49e0a78f.tar.gz
sl0ppij-070de7a4d14e5670e1d143bfecfe4daf49e0a78f.tar.xz
sl0ppij-070de7a4d14e5670e1d143bfecfe4daf49e0a78f.zip
Fix: move `colors_transform` to `colorsys` (#832)
* `colors_transform` is deprecated and superceded by `colorsys` ref: https://crates.io/crates/colors-transform
-rw-r--r--Cargo.lock8
-rw-r--r--zellij-utils/Cargo.toml2
-rw-r--r--zellij-utils/src/shared.rs7
3 files changed, 8 insertions, 9 deletions
diff --git a/Cargo.lock b/Cargo.lock
index f092f778..9f93aded 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -373,10 +373,10 @@ dependencies = [
]
[[package]]
-name = "colors-transform"
-version = "0.2.11"
+name = "colorsys"
+version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9226dbc05df4fb986f48d730b001532580883c4c06c5d1c213f4b34c1c157178"
+checksum = "4dfdf9179d546b55ff3f88c9d93ecfaa3e9760163da5a1080af5243230dbbb70"
[[package]]
name = "concurrent-queue"
@@ -2906,7 +2906,7 @@ dependencies = [
"async-std",
"backtrace",
"bincode",
- "colors-transform",
+ "colorsys",
"crossbeam",
"directories-next",
"interprocess",
diff --git a/zellij-utils/Cargo.toml b/zellij-utils/Cargo.toml
index eab045dd..bf4654e9 100644
--- a/zellij-utils/Cargo.toml
+++ b/zellij-utils/Cargo.toml
@@ -11,7 +11,7 @@ license = "MIT"
[dependencies]
backtrace = "0.3.55"
bincode = "1.3.1"
-colors-transform = "0.2.5"
+colorsys = "0.6.5"
crossbeam = "0.8.0"
directories-next = "2.0"
interprocess = "1.1.1"
diff --git a/zellij-utils/src/shared.rs b/zellij-utils/src/shared.rs
index 06d1378d..37dfc3be 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 {