From 1e9e142b05b4f1b25782a063a996c3fb942884d0 Mon Sep 17 00:00:00 2001 From: Dukantic Date: Wed, 9 Jul 2025 17:20:00 +0200 Subject: [PATCH] better color --- src/main.rs | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 751195a..fd72c02 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,4 @@ mod polygon_draw; -use iced::widget::canvas::Program; use polygon_draw::Polygon; mod music; @@ -14,6 +13,10 @@ use utils::str_to_sec; use std::fs; use iced::Element; +use iced::{ + Color, Length, Task, Theme, + widget::{Column, button, canvas, container, pick_list, row, scrollable, slider}, +}; use iced::{ Font, widget::{ @@ -21,10 +24,6 @@ use iced::{ text_input::{Icon, Side}, }, }; -use iced::{ - Length, Task, Theme, - widget::{Column, button, canvas, container, pick_list, row, scrollable, slider}, -}; use regex::Regex; use std::f32::consts::PI; @@ -36,8 +35,26 @@ use kira::{ use crate::utils::delta_to_string; fn main() -> iced::Result { + let polytheme: Theme = { + let back = Color::from_rgb8(0x25, 0x26, 0x27); + let text = Color::from_rgb8(0xD3, 0xD4, 0xD9); + let prim = Color::from_rgb8(0x4B, 0x88, 0xA2); + let succ = Color::from_rgb8(0xFF, 0xF9, 0xFB); + let dan = Color::from_rgb8(0xBB, 0x0A, 0x21); + + Theme::custom( + String::from("PolyTheme"), + iced::theme::Palette { + background: back, + text: text, + primary: prim, + success: succ, + danger: dan, + }, + ) + }; iced::application("My App", MyApp::update, MyApp::view) - .theme(|_| Theme::Dark) + .theme(move |_| polytheme.clone()) .subscription(MyApp::subscription) .run_with(MyApp::new) }