use crate::{Map, Mask, Point};
-use crossterm::style::{Attribute, Color};
+use crossterm::style::{
+ Attribute, Attributes,
+ Color::{Black, Green, Grey},
+ Colors,
+};
use ndarray::Array2;
use rand::{thread_rng, Rng};
use std::{cell::Cell, ops::Deref};
('●', '◌')
}
- fn fg_colors(&self) -> (Color, Color) {
- (Color::Green, Color::Grey)
+ fn on_colors(&self) -> Colors {
+ Colors::new(Green, Black)
}
- fn bg_colors(&self) -> (Color, Color) {
- (Color::Black, Color::Black)
+ fn off_colors(&self) -> Colors {
+ Colors::new(Grey, Black)
}
- fn styles(&self) -> (Attribute, Attribute) {
- (Attribute::Bold, Attribute::Reset)
+ fn styles(&self) -> (Attributes, Attributes) {
+ (Attribute::Bold.into(), Attribute::Reset.into())
}
fn try_point(&self, point: Point) -> bool {
use crate::Point;
-use crossterm::style::{Attribute, Color};
+use crossterm::style::{
+ Attribute, Attributes,
+ Color::{Black, Grey, White},
+ Colors,
+};
use ndarray::Array2;
use std::ops::Deref;
fn x_size(&self) -> usize;
fn y_size(&self) -> usize;
fn characters(&self) -> (char, char);
- fn fg_colors(&self) -> (Color, Color);
- fn bg_colors(&self) -> (Color, Color);
- fn styles(&self) -> (Attribute, Attribute);
+ fn on_colors(&self) -> Colors;
+ fn off_colors(&self) -> Colors;
+ fn styles(&self) -> (Attributes, Attributes);
fn update(&mut self);
}
('■', '□')
}
- fn fg_colors(&self) -> (Color, Color) {
- (Color::White, Color::Grey)
+ fn on_colors(&self) -> Colors {
+ Colors::new(White, Black)
}
- fn bg_colors(&self) -> (Color, Color) {
- (Color::Black, Color::Black)
+ fn off_colors(&self) -> Colors {
+ Colors::new(Grey, Black)
}
- fn styles(&self) -> (Attribute, Attribute) {
- (Attribute::Bold, Attribute::Reset)
+ fn styles(&self) -> (Attributes, Attributes) {
+ let on = Attributes::from(Attribute::Bold);
+ let off = Attributes::from(Attribute::Reset);
+ (on, off)
}
fn update(&mut self) {}