aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/theme.rs
diff options
context:
space:
mode:
authorKeith Simmons2021-06-25 03:58:15 +0000
committerGitHub2021-06-25 03:58:15 +0000
commit4418e17547562e211952b9e8585916e04b858b3b (patch)
tree8427958809392969b035967c1c69e9507207d00e /helix-view/src/theme.rs
parent74cc4b4a49e05462b2b543737ad4dc32e2265794 (diff)
reverse the dependency between helix-tui and helix-view (#366)
* reverse the dependency between helix-tui and helix-view by moving a fiew types to view * fix tests * clippy and format fixes Co-authored-by: Keith Simmons <keithsim@microsoft.com>
Diffstat (limited to 'helix-view/src/theme.rs')
-rw-r--r--helix-view/src/theme.rs81
1 files changed, 1 insertions, 80 deletions
diff --git a/helix-view/src/theme.rs b/helix-view/src/theme.rs
index 66b91294..947c6ee0 100644
--- a/helix-view/src/theme.rs
+++ b/helix-view/src/theme.rs
@@ -9,86 +9,7 @@ use once_cell::sync::Lazy;
use serde::{Deserialize, Deserializer};
use toml::Value;
-#[cfg(feature = "term")]
-pub use tui::style::{Color, Modifier, Style};
-
-// #[derive(Clone, Copy, PartialEq, Eq, Default, Hash)]
-// pub struct Color {
-// pub r: u8,
-// pub g: u8,
-// pub b: u8,
-// }
-
-// impl Color {
-// pub fn new(r: u8, g: u8, b: u8) -> Self {
-// Self { r, g, b }
-// }
-// }
-
-// #[cfg(feature = "term")]
-// impl Into<tui::style::Color> for Color {
-// fn into(self) -> tui::style::Color {
-// tui::style::Color::Rgb(self.r, self.g, self.b)
-// }
-// }
-
-// impl std::str::FromStr for Color {
-// type Err = ();
-
-// /// Tries to parse a string (`'#FFFFFF'` or `'FFFFFF'`) into RGB.
-// fn from_str(input: &str) -> Result<Self, Self::Err> {
-// let input = input.trim();
-// let input = match (input.chars().next(), input.len()) {
-// (Some('#'), 7) => &input[1..],
-// (_, 6) => input,
-// _ => return Err(()),
-// };
-
-// u32::from_str_radix(&input, 16)
-// .map(|s| Color {
-// r: ((s >> 16) & 0xFF) as u8,
-// g: ((s >> 8) & 0xFF) as u8,
-// b: (s & 0xFF) as u8,
-// })
-// .map_err(|_| ())
-// }
-// }
-
-// #[derive(Clone, Copy, PartialEq, Eq, Default, Hash)]
-// pub struct Style {
-// pub fg: Option<Color>,
-// pub bg: Option<Color>,
-// // TODO: modifiers (bold, underline, italic, etc)
-// }
-
-// impl Style {
-// pub fn fg(mut self, fg: Color) -> Self {
-// self.fg = Some(fg);
-// self
-// }
-
-// pub fn bg(mut self, bg: Color) -> Self {
-// self.bg = Some(bg);
-// self
-// }
-// }
-
-// #[cfg(feature = "term")]
-// impl Into<tui::style::Style> for Style {
-// fn into(self) -> tui::style::Style {
-// let style = tui::style::Style::default();
-
-// if let Some(fg) = self.fg {
-// style.fg(fg.into());
-// }
-
-// if let Some(bg) = self.bg {
-// style.bg(bg.into());
-// }
-
-// style
-// }
-// }
+pub use crate::graphics::{Color, Modifier, Style};
/// Color theme for syntax highlighting.