Use trans_flag global from sketchlib

main
Charlotte Som 2021-09-02 03:56:57 +01:00
parent 2ce3eb8195
commit d76c19d625
1 changed files with 2 additions and 7 deletions

View File

@ -1,4 +1,5 @@
use sketchlib::nannou; use sketchlib::nannou;
use sketchlib::palettes::TRANS_FLAG;
use sketchlib::prelude::*; use sketchlib::prelude::*;
fn main() { fn main() {
@ -35,18 +36,12 @@ fn model(_app: &App) -> Model {
const G: f64 = 6.67408e-11; const G: f64 = 6.67408e-11;
let palette = &[
rgb(85.0 / 255.0, 205.0 / 255.0, 252.0 / 255.0),
rgb(1.0, 1.0, 1.0),
rgb(247.0 / 255.0, 168.0 / 255.0, 184.0 / 255.0),
];
let mut theta = 0.0; let mut theta = 0.0;
for i in 1..=256 { for i in 1..=256 {
let r = 25.0 + 5.0 * i as f64; let r = 25.0 + 5.0 * i as f64;
let m = 50000000000u64 / i; let m = 50000000000u64 / i;
let curr_color = palette[i as usize % palette.len()]; let curr_color = TRANS_FLAG[i as usize % TRANS_FLAG.len()];
let speed = (G * MASS_SUN as f64 / r).sqrt(); let speed = (G * MASS_SUN as f64 / r).sqrt();
println!("{}", speed); println!("{}", speed);