Introduce specific types for each palette::Extended field

We will have more control over color calculations for each semantic purpose this way.
This commit is contained in:
Héctor Ramón Jiménez 2022-05-26 23:58:56 +02:00
parent d5bc610d01
commit d988d813d7
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
4 changed files with 142 additions and 88 deletions

View file

@ -12,8 +12,8 @@ use iced::theme::{self, Theme};
use iced::time;
use iced::window;
use iced::{
Alignment, Application, Checkbox, Column, Command, Container, Element,
Length, Row, Settings, Subscription, Text,
Alignment, Application, Checkbox, Column, Command, Element, Length, Row,
Settings, Subscription, Text,
};
use preset::Preset;
use std::time::{Duration, Instant};
@ -143,20 +143,19 @@ impl Application for GameOfLife {
self.grid.preset(),
);
let content = Column::new()
Column::new()
.push(
self.grid
.view()
.map(move |message| Message::Grid(message, version)),
)
.push(controls);
Container::new(content)
.width(Length::Fill)
.height(Length::Fill)
.style(style::Container)
.push(controls)
.into()
}
fn theme(&self) -> Theme {
Theme::Dark
}
}
mod grid {