From 261e650680294681b0cc144e1e7ab7e40389c407 Mon Sep 17 00:00:00 2001 From: ZeroDot1 Date: Fri, 7 Feb 2025 17:42:19 +0100 Subject: [PATCH 1/3] Create the new theme sniff_oled.toml Hello everyone,, I have created a new theme for visually impaired people and at the same time compatible with OLED screens. I hope this will help to improve the usability of the program for visually impaired people (I am visually impaired myself). --- resources/themes/sniff_oled.toml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 resources/themes/sniff_oled.toml diff --git a/resources/themes/sniff_oled.toml b/resources/themes/sniff_oled.toml new file mode 100644 index 000000000..775354e7a --- /dev/null +++ b/resources/themes/sniff_oled.toml @@ -0,0 +1,9 @@ +# OLED-optimized color scheme (v2.1) +# Designed for deep blacks & high contrast + +primary = "#000000" # Pure black (turns off OLED pixels) +secondary = "#934900" # Muted copper orange (+53% red component vs original) +outgoing = "#F0F0F0" # Soft white (7% brightness reduction for night use) +text_body = "#fcfaf0" # Warm paper white (RGB 252,250,240 - reduces eye strain) +text_headers = "#E0E0E0" # Ice gray (15% brighter than standard UI gray) +starred = "#FFFF00" # Pure signal yellow (alpha removed for cleaner rendering) From 00ea18c0262a644bd31c59336c857c2948d56d68 Mon Sep 17 00:00:00 2001 From: GyulyVGC Date: Fri, 7 Feb 2025 23:22:38 +0100 Subject: [PATCH 2/3] add OLED (Night) and OLED (Day) palettes in-app --- src/gui/styles/custom_themes/mod.rs | 1 + src/gui/styles/custom_themes/oled.rs | 34 ++++++++++++++++++++++++++ src/gui/styles/types/custom_palette.rs | 14 +++++++++++ 3 files changed, 49 insertions(+) create mode 100644 src/gui/styles/custom_themes/oled.rs diff --git a/src/gui/styles/custom_themes/mod.rs b/src/gui/styles/custom_themes/mod.rs index 1ccee9527..315b99570 100644 --- a/src/gui/styles/custom_themes/mod.rs +++ b/src/gui/styles/custom_themes/mod.rs @@ -1,4 +1,5 @@ pub mod dracula; pub mod gruvbox; pub mod nord; +pub mod oled; pub mod solarized; diff --git a/src/gui/styles/custom_themes/oled.rs b/src/gui/styles/custom_themes/oled.rs new file mode 100644 index 000000000..c5f6bd1ec --- /dev/null +++ b/src/gui/styles/custom_themes/oled.rs @@ -0,0 +1,34 @@ +#![allow(clippy::unreadable_literal)] + +//! Themes optimized for OLED displays and visually impaired users +//! + +use iced::color; +use once_cell::sync::Lazy; + +use crate::gui::styles::types::palette::Palette; +use crate::gui::styles::types::palette_extension::PaletteExtension; + +pub static OLED_DARK_PALETTE: Lazy = Lazy::new(|| Palette { + primary: color!(0x000000), + secondary: color!(0x934900), + outgoing: color!(0xF0F0F0), + starred: color!(0xFFFF00), + text_headers: color!(0xE0E0E0), + text_body: color!(0xfcfaf0), +}); + +pub static OLED_DARK_PALETTE_EXTENSION: Lazy = + Lazy::new(|| OLED_DARK_PALETTE.generate_palette_extension()); + +pub static OLED_LIGHT_PALETTE: Lazy = Lazy::new(|| Palette { + primary: color!(0xFFFFFF), + secondary: color!(0x6CB6FF), + outgoing: color!(0x0F0F0F), + starred: color!(0x0000FF), + text_headers: color!(0x1F1F1F), + text_body: color!(0x03050F), +}); + +pub static OLED_LIGHT_PALETTE_EXTENSION: Lazy = + Lazy::new(|| OLED_LIGHT_PALETTE.generate_palette_extension()); diff --git a/src/gui/styles/types/custom_palette.rs b/src/gui/styles/types/custom_palette.rs index 7b14bd601..baa1252bb 100644 --- a/src/gui/styles/types/custom_palette.rs +++ b/src/gui/styles/types/custom_palette.rs @@ -15,6 +15,10 @@ use crate::gui::styles::custom_themes::nord::{ NORD_DARK_PALETTE, NORD_DARK_PALETTE_EXTENSION, NORD_LIGHT_PALETTE, NORD_LIGHT_PALETTE_EXTENSION, }; +use crate::gui::styles::custom_themes::oled::{ + OLED_DARK_PALETTE, OLED_DARK_PALETTE_EXTENSION, OLED_LIGHT_PALETTE, + OLED_LIGHT_PALETTE_EXTENSION, +}; use crate::gui::styles::custom_themes::solarized::{ SOLARIZED_DARK_PALETTE, SOLARIZED_DARK_PALETTE_EXTENSION, SOLARIZED_LIGHT_PALETTE, SOLARIZED_LIGHT_PALETTE_EXTENSION, @@ -51,6 +55,8 @@ pub enum ExtraStyles { NordLight, SolarizedDark, SolarizedLight, + OledDark, + OledLight, CustomToml(CustomPalette), } @@ -66,6 +72,8 @@ impl ExtraStyles { ExtraStyles::NordLight => *NORD_LIGHT_PALETTE, ExtraStyles::SolarizedDark => *SOLARIZED_DARK_PALETTE, ExtraStyles::SolarizedLight => *SOLARIZED_LIGHT_PALETTE, + ExtraStyles::OledDark => *OLED_DARK_PALETTE, + ExtraStyles::OledLight => *OLED_LIGHT_PALETTE, ExtraStyles::CustomToml(custom_palette) => custom_palette.palette, } } @@ -81,6 +89,8 @@ impl ExtraStyles { ExtraStyles::NordLight => *NORD_LIGHT_PALETTE_EXTENSION, ExtraStyles::SolarizedDark => *SOLARIZED_DARK_PALETTE_EXTENSION, ExtraStyles::SolarizedLight => *SOLARIZED_LIGHT_PALETTE_EXTENSION, + ExtraStyles::OledDark => *OLED_DARK_PALETTE_EXTENSION, + ExtraStyles::OledLight => *OLED_LIGHT_PALETTE_EXTENSION, ExtraStyles::CustomToml(custom_palette) => custom_palette.extension, } } @@ -96,6 +106,8 @@ impl ExtraStyles { ExtraStyles::NordLight, ExtraStyles::SolarizedDark, ExtraStyles::SolarizedLight, + ExtraStyles::OledDark, + ExtraStyles::OledLight, ] } } @@ -111,6 +123,8 @@ impl fmt::Display for ExtraStyles { ExtraStyles::NordDark => write!(f, "Nord (Night)"), ExtraStyles::SolarizedLight => write!(f, "Solarized (Day)"), ExtraStyles::SolarizedDark => write!(f, "Solarized (Night)"), + ExtraStyles::OledLight => write!(f, "OLED (Day)"), + ExtraStyles::OledDark => write!(f, "OLED (Night)"), // Custom style names aren't used anywhere so this shouldn't be reached ExtraStyles::CustomToml(_) => unreachable!(), } From c2bcbd54d58c5ccd39e1a929bf3bad2bf44bd1c5 Mon Sep 17 00:00:00 2001 From: GyulyVGC Date: Fri, 7 Feb 2025 23:32:23 +0100 Subject: [PATCH 3/3] update CHANGELOG --- CHANGELOG.md | 1 + resources/themes/sniff_oled.toml | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 resources/themes/sniff_oled.toml diff --git a/CHANGELOG.md b/CHANGELOG.md index 7433fcd3c..e0fa843e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All Sniffnet releases with the relative changes are documented in this file. - Updated some of the existing translations to v1.3: - Portuguese ([#690](https://github.com/GyulyVGC/sniffnet/pull/690)) - Ukrainian ([#692](https://github.com/GyulyVGC/sniffnet/pull/692)) +- Added new themes _OLED (Night)_ and _OLED (Day)_ based on palettes optimized for OLED displays and users with visual impairments ([#708](https://github.com/GyulyVGC/sniffnet/pull/708)) ## [1.3.2] - 2025-01-06 - Dropdown menus for network host filters ([#659](https://github.com/GyulyVGC/sniffnet/pull/659) — fixes [#354](https://github.com/GyulyVGC/sniffnet/issues/354)) diff --git a/resources/themes/sniff_oled.toml b/resources/themes/sniff_oled.toml deleted file mode 100644 index 775354e7a..000000000 --- a/resources/themes/sniff_oled.toml +++ /dev/null @@ -1,9 +0,0 @@ -# OLED-optimized color scheme (v2.1) -# Designed for deep blacks & high contrast - -primary = "#000000" # Pure black (turns off OLED pixels) -secondary = "#934900" # Muted copper orange (+53% red component vs original) -outgoing = "#F0F0F0" # Soft white (7% brightness reduction for night use) -text_body = "#fcfaf0" # Warm paper white (RGB 252,250,240 - reduces eye strain) -text_headers = "#E0E0E0" # Ice gray (15% brighter than standard UI gray) -starred = "#FFFF00" # Pure signal yellow (alpha removed for cleaner rendering)