added alpha channel
This commit is contained in:
1 parent
f6ef9981dd
commit
7a1d8f0532
10 files changed
+821
-277
No files matched your search
@@ -0,0 +1,48 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
fn main() {
|
||||
// rink::launch(app);
|
||||
rink::launch_cfg(
|
||||
app,
|
||||
rink::Config {
|
||||
rendering_mode: rink::RenderingMode::Ansi,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
let steps = 50;
|
||||
cx.render(rsx! {
|
||||
div{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
flex_direction: "column",
|
||||
(0..=steps).map(|x|
|
||||
{
|
||||
let hue = x as f32*360.0/steps as f32;
|
||||
cx.render(rsx! {
|
||||
div{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
flex_direction: "row",
|
||||
(0..=steps).map(|y|
|
||||
{
|
||||
let alpha = y as f32*100.0/steps as f32;
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
left: "{x}px",
|
||||
top: "{y}px",
|
||||
width: "10%",
|
||||
height: "100%",
|
||||
background_color: "hsl({hue}, 100%, 50%, {alpha}%)",
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user