ui: introduce dark theme colors

This commit is contained in:
edouard 2023-04-13 13:15:31 +02:00
parent ff38b58ede
commit 2e75d4b602
3 changed files with 56 additions and 9 deletions

View File

@ -1,6 +1,6 @@
mod section;
use iced::widget::{button, column, container, row, text, Space};
use iced::widget::{button, column, container, row, scrollable, text, Space};
use iced::{executor, Application, Command, Length, Settings, Subscription};
use liana_ui::{component::text::*, theme, widget::*};
@ -128,10 +128,10 @@ impl Application for DesignSystem {
container(row![
sidebar.width(Length::Units(200)),
Space::with_width(Length::Units(150)),
column![
scrollable(column![
Space::with_height(Length::Units(150)),
container(self.sections[self.current].view()).width(Length::Fill)
]
]),
])
.width(Length::Fill)
.height(Length::Fill)

View File

@ -43,12 +43,18 @@ impl Section for Colors {
column![
h1(self.title()),
column![
color_row(color::BLACK, "BLACK (0,0,0)"),
color_row(color::LIGHT_BLACK, "LIGHT_BLACK #141414 original design"),
color_row(color::GREEN, "GREEN #00FF66 original design"),
color_row(color::DARK_GREY, "DARK_GREY #555555"),
color_row(color::GREY, "GREY #CCCCCC original design"),
color_row(color::LIGHT_GREY, "LIGHT_GREY #E6E6E6 original design"),
color_row(color::dark::BLACK, "BLACK (0,0,0)"),
color_row(
color::dark::LIGHT_BLACK,
"LIGHT_BLACK #141414 original design"
),
color_row(color::dark::GREEN, "GREEN #00FF66 original design"),
color_row(color::dark::GREY_5, "GREY #272727"),
color_row(color::dark::GREY_4, "GREY #424242"),
color_row(color::dark::GREY_3, "GREY #717171"),
color_row(color::dark::GREY_2, "GREY #CCCCCC"),
color_row(color::dark::GREY_1, "GREY #E6E6E6"),
color_row(color::dark::WHITE, "WHITE #FFFFFF"),
color_row(color::RED, "RED #F04359"),
color_row(color::ORANGE, "ORANGE #FFa700")
]

View File

@ -41,6 +41,47 @@ pub const RED: Color = Color::from_rgb(
pub const ORANGE: Color =
Color::from_rgb(0xFF as f32 / 255.0, 0xa7 as f32 / 255.0, 0x0 as f32 / 255.0);
pub mod dark {
use iced::Color;
pub const BLACK: Color = iced::Color::BLACK;
pub const LIGHT_BLACK: Color = Color::from_rgb(
0x14 as f32 / 255.0,
0x14 as f32 / 255.0,
0x14 as f32 / 255.0,
);
pub const GREY_5: Color = Color::from_rgb(
0x27 as f32 / 255.0,
0x27 as f32 / 255.0,
0x27 as f32 / 255.0,
);
pub const GREY_4: Color = Color::from_rgb(
0x42 as f32 / 255.0,
0x42 as f32 / 255.0,
0x42 as f32 / 255.0,
);
pub const GREY_3: Color = Color::from_rgb(
0x71 as f32 / 255.0,
0x71 as f32 / 255.0,
0x71 as f32 / 255.0,
);
pub const GREY_2: Color = Color::from_rgb(
0xCC as f32 / 255.0,
0xCC as f32 / 255.0,
0xCC as f32 / 255.0,
);
pub const GREY_1: Color = Color::from_rgb(
0xE6 as f32 / 255.0,
0xE6 as f32 / 255.0,
0xE6 as f32 / 255.0,
);
pub const WHITE: Color = iced::Color::WHITE;
pub const GREEN: Color = Color::from_rgb(
0x00 as f32 / 255.0,
0xFF as f32 / 255.0,
0x66 as f32 / 255.0,
);
}
pub mod legacy {
use iced::Color;