color
This commit is contained in:
parent
3de035e73c
commit
079911b947
2 changed files with 77 additions and 2 deletions
10
src/main.rs
10
src/main.rs
|
@ -2,7 +2,7 @@ use std::fs::File;
|
|||
use std::io::BufReader;
|
||||
use std::net::{ToSocketAddrs, UdpSocket};
|
||||
use std::time::Duration;
|
||||
|
||||
mod color;
|
||||
// Constants from the C code
|
||||
const QUEUE_LEN: usize = 1000;
|
||||
const MSG_PAYLOAD_SIZE: usize = 7 * 211;
|
||||
|
@ -189,7 +189,13 @@ impl Drawable for Circle {
|
|||
|
||||
/// Helper method to draw the 8 symmetric points for a given (x, y) offset.
|
||||
fn draw_and_move(&mut self, display: &mut Display) {
|
||||
self.draw_circle(display,self.x,self.y,self.radius,255,255,255);
|
||||
let hsv_color = color::Hsv {
|
||||
h: 360,
|
||||
s: 1.0,
|
||||
v: 1.0,
|
||||
};
|
||||
let rgb: color::Rgb = hsv_color.into();
|
||||
self.draw_circle(display,self.x,self.y,self.radius,rgb.r,rgb.g,rgb.b);
|
||||
self.radius = self.radius + 1;
|
||||
if self.radius > 1080/2 {
|
||||
self.radius = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue