Skip to content

Commit

Permalink
improved Catppuccin theme in the provided sample TOML file
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed Dec 9, 2023
1 parent 59a3eb7 commit 7459cb1
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 39 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,24 +410,24 @@ The currently usable hotkeys are reported in the following.
The TOML must follow this format:
```toml
# Colors are in RGB/RGBA hexadecimal.
primary = "#1e1e2e" # Background
secondary = "#89b4fa" # Headers / incoming connections
buttons = "#313244" # Buttons
outgoing = "#f5c2e7" # Outgoing connections
text_headers = "#11111b" # Text headers
text_body = "#cdd6f4" # Text body
starred = "#f9e2afaa" # Favorites
primary = "#303446" # Background
secondary = "#a6d189" # Headers / incoming connections
buttons = "#414559" # Buttons
outgoing = "#f4b8e4" # Outgoing connections
text_headers = "#232634" # Text headers
text_body = "#c6d0f5" # Text body
starred = "#e5c890aa" # Favorites

# The following parameters are in the range [0.0, 1.0].
round_borders_alpha = 0.3 # Borders opacity
round_containers_alpha = 0.15 # Containers opacity
round_borders_alpha = 0.4 # Borders opacity
round_containers_alpha = 0.25 # Containers opacity
chart_badge_alpha = 0.2 # Chart opacity

# Set to true if the theme is dark, false if it's light.
nightly = true
```

The example theme above uses colors from [Catppuccin Mocha](https://github.com/catppuccin/catppuccin).
The example theme above uses colors from [Catppuccin](https://github.com/catppuccin/catppuccin).

To use a custom theme for your instance of Sniffnet, specify the path of your TOML file in the application's
settings (at the bottom of the style tab).
Expand Down
16 changes: 16 additions & 0 deletions resources/themes/catppuccin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Colors are in RGB/RGBA hexadecimal.
primary = "#303446" # Background
secondary = "#a6d189" # Headers / incoming connections
buttons = "#414559" # Buttons
outgoing = "#f4b8e4" # Outgoing connections
text_headers = "#232634" # Text headers
text_body = "#c6d0f5" # Text body
starred = "#e5c890aa" # Favorites

# The following parameters are in the range [0.0, 1.0].
round_borders_alpha = 0.4 # Borders opacity
round_containers_alpha = 0.25 # Containers opacity
chart_badge_alpha = 0.2 # Chart opacity

# Set to true if the theme is dark, false if it's light.
nightly = true
16 changes: 0 additions & 16 deletions resources/themes/catppuccin_mocha.toml

This file was deleted.

22 changes: 11 additions & 11 deletions src/gui/styles/types/custom_palette.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,21 +213,21 @@ mod tests {
)
}

// NOTE: This has to be updated if `resources/themes/catppuccin_mocha.toml` changes
// NOTE: This has to be updated if `resources/themes/catppuccin.toml` changes
fn catppuccin_style() -> CustomPalette {
CustomPalette {
palette: Palette {
primary: color!(30, 30, 46),
secondary: color!(137, 180, 250),
buttons: color!(49, 50, 68),
outgoing: color!(245, 194, 231),
text_headers: color!(17, 17, 27),
text_body: color!(205, 214, 244),
primary: color!(0x30, 0x34, 0x46),
secondary: color!(0xa6, 0xd1, 0x89),
buttons: color!(0x41, 0x45, 0x59),
outgoing: color!(0xf4, 0xb8, 0xe4),
text_headers: color!(0x23, 0x26, 0x34),
text_body: color!(0xc6, 0xd0, 0xf5),
},
extension: PaletteExtension {
starred: color!(249, 226, 175, 0.6666667),
round_borders_alpha: 0.3,
round_containers_alpha: 0.15,
starred: color!(0xe5, 0xc8, 0x90, 0.6666667),
round_borders_alpha: 0.4,
round_containers_alpha: 0.25,
chart_badge_alpha: 0.2,
nightly: true,
},
Expand All @@ -237,7 +237,7 @@ mod tests {
#[test]
fn custompalette_from_file_de() -> Result<(), toml::de::Error> {
let style = catppuccin_style();
let style_de = CustomPalette::from_file(style_path("catppuccin_mocha"))?;
let style_de = CustomPalette::from_file(style_path("catppuccin"))?;

assert_eq!(style, style_de);
Ok(())
Expand Down
4 changes: 2 additions & 2 deletions src/gui/types/sniffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,8 @@ mod tests {
};
use crate::notifications::types::sound::Sound;
use crate::{
AppProtocol, ByteMultiple, ChartType, Configs, InfoTraffic, IpVersion, Language,
ReportSortType, RunningPage, Sniffer, StyleType, TransProtocol,
AppProtocol, ByteMultiple, ChartType, Configs, IpVersion, Language, ReportSortType,
RunningPage, Sniffer, StyleType, TransProtocol,
};

#[test]
Expand Down

0 comments on commit 7459cb1

Please sign in to comment.