colorfull
This commit is contained in:
@@ -36,9 +36,9 @@ use kira::{
|
||||
use crate::utils::delta_to_string;
|
||||
fn main() -> iced::Result {
|
||||
let polytheme: Theme = {
|
||||
let back = Color::from_rgb8(0x25, 0x26, 0x27);
|
||||
let back = Color::from_rgb8(39, 63, 79);
|
||||
let text = Color::from_rgb8(0xD3, 0xD4, 0xD9);
|
||||
let prim = Color::from_rgb8(0x4B, 0x88, 0xA2);
|
||||
let prim = Color::from_rgb8(230, 82, 31);
|
||||
let succ = Color::from_rgb8(0xFF, 0xF9, 0xFB);
|
||||
let dan = Color::from_rgb8(0xBB, 0x0A, 0x21);
|
||||
|
||||
|
||||
24
src/music.rs
24
src/music.rs
@@ -176,22 +176,13 @@ impl canvas::Program<Message> for Music {
|
||||
iced::Point { x: x, y: 0.0 },
|
||||
frame.size(),
|
||||
if toggle_color {
|
||||
Color::from_rgb(0.3, 0.3, 0.3)
|
||||
Color::from_rgb8(27, 60, 83)
|
||||
} else {
|
||||
Color::from_rgb(0.1, 0.1, 0.1)
|
||||
Color::from_rgb8(69, 104, 130)
|
||||
},
|
||||
);
|
||||
toggle_color = !toggle_color;
|
||||
}
|
||||
frame.stroke_rectangle(
|
||||
iced::Point { x: 0.0, y: 0.0 },
|
||||
frame.size(),
|
||||
Stroke {
|
||||
width: 16.0,
|
||||
..Stroke::default()
|
||||
},
|
||||
);
|
||||
|
||||
let x = self.current_delta / self.length * w + 8.;
|
||||
frame.stroke_rectangle(
|
||||
iced::Point::new(x, 0.),
|
||||
@@ -201,7 +192,16 @@ impl canvas::Program<Message> for Music {
|
||||
},
|
||||
Stroke {
|
||||
width: 4.0,
|
||||
style: Style::Solid(Color::from_rgb(1.0, 0.0, 0.0)),
|
||||
style: Style::Solid(Color::from_rgba(1.0, 0.0, 0.0, 1.)),
|
||||
..Stroke::default()
|
||||
},
|
||||
);
|
||||
frame.stroke_rectangle(
|
||||
iced::Point { x: 0.0, y: 0.0 },
|
||||
frame.size(),
|
||||
Stroke {
|
||||
width: 16.0,
|
||||
style: Style::Solid(Color::from_rgb8(207, 74, 28)),
|
||||
..Stroke::default()
|
||||
},
|
||||
);
|
||||
|
||||
@@ -67,13 +67,18 @@ impl<Message> canvas::Program<Message> for PolygonFrame {
|
||||
let radius = frame.size().width.min(frame.size().height) / 2.0 - 32.0;
|
||||
let mut vec = Vector::new(0.0, -radius);
|
||||
let c = frame.center();
|
||||
frame.fill_rectangle(
|
||||
iced::Point { x: 0., y: 0. },
|
||||
frame.size(),
|
||||
Color::from_rgb8(27, 60, 83),
|
||||
);
|
||||
// Draw Circle
|
||||
let circle = canvas::Path::circle(frame.center(), radius);
|
||||
frame.stroke(
|
||||
&circle,
|
||||
Stroke {
|
||||
width: 6.0,
|
||||
style: Style::Solid(Color::from_rgba(0.0, 0.0, 0.0, 1.0)),
|
||||
style: Style::Solid(Color::from_rgb8(210, 193, 182)),
|
||||
..Stroke::default()
|
||||
},
|
||||
);
|
||||
@@ -100,7 +105,7 @@ impl<Message> canvas::Program<Message> for PolygonFrame {
|
||||
}
|
||||
|
||||
// Draw the red dot on the current position
|
||||
let dot = canvas::Path::circle(frame.center() + vec.rotate(self.teta), 5.0);
|
||||
let dot = canvas::Path::circle(frame.center() + vec.rotate(self.teta), 10.0);
|
||||
frame.fill(&dot, Color::from_rgb(1.0, 0.0, 0.0));
|
||||
|
||||
// Draw the frame
|
||||
@@ -109,6 +114,7 @@ impl<Message> canvas::Program<Message> for PolygonFrame {
|
||||
frame.size(),
|
||||
Stroke {
|
||||
width: 16.0,
|
||||
style: Style::Solid(Color::from_rgb8(207, 74, 28)),
|
||||
..Stroke::default()
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user