mirror of
https://github.com/exoticorn/curlywas.git
synced 2026-01-20 11:46:43 +01:00
some more experiments toward a better palette
This commit is contained in:
@@ -36,16 +36,17 @@ start fn gen_palette() {
|
|||||||
let avg: f32;
|
let avg: f32;
|
||||||
loop gradients {
|
loop gradients {
|
||||||
let lazy scale = (i % 48) as f32 / 48 as f32;
|
let lazy scale = (i % 48) as f32 / 48 as f32;
|
||||||
let inline angle = i as f32 * (3.1416 / 1.5) - i as f32 * (3.1416 / (11.0 * 16.0 * 1.5));
|
let inline angle = i as f32 * (3.1416 / 1.5 - 3.1416 / (11.0 * 16.0 * 1.5));
|
||||||
let c = sin(angle) * 1.0 + 0.7;
|
let lazy c = 0.4 - cos(angle);
|
||||||
let limit = avg + 0.8;
|
let inline ulimit = avg + 0.8;
|
||||||
avg = avg + (c - avg) * 0.5;
|
let inline llimit = avg - 0.8;
|
||||||
let lazy a = min(c, limit) * scale;
|
let lazy a = max(llimit, min(ulimit, c)) * (scale + 0.05);
|
||||||
let lazy b = scale * scale * 0.6;
|
let lazy b = scale * scale * 0.8;
|
||||||
let inline v = (select(i < 11*16*3, max(0 as f32, min(a + b - a * b, 1 as f32)), scale) * 255 as f32) as i32;
|
let inline v = (select(i < 11*16*3, max(0 as f32, min(a + b - a * b, 1 as f32)), scale) * 255 as f32) as i32;
|
||||||
(i%3 + i/3*4)?(120+320*240) = v;
|
(i%3 + i/3*4)?(120+320*240) = v;
|
||||||
|
avg = (avg + c) * 0.5;
|
||||||
|
|
||||||
branch_if (i := i - 1) >= 0: gradients;
|
branch_if i := i - 1: gradients;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = 255;
|
i = 255;
|
||||||
|
|||||||
Reference in New Issue
Block a user