Crates.io | photonic-dynamic |
lib.rs | photonic-dynamic |
version | |
source | src |
created_at | 2024-10-22 21:58:03.294179 |
updated_at | 2024-10-22 21:58:03.294179 |
description | Dynamic light controller and animator |
homepage | https://photonic.live |
repository | |
max_upload_size | |
id | 1419375 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Photonic is a open-source rust framework for lighting animation and control.
Whether you're creating a dazzling lighting setup for an event or enhancing the ambient lighting of your living space, Photonic provides a verstaile platform for managing and controlling your lighting setup.
Photonic main component is a Scene. A Scene consists of multiple nodes, attributes and inputs. The nodes form a graph where each frame is passed from node to node and each node can process and manipulate the frame. Each node exposes attributes that control the behavior of the node. Depending on how attributes are assigned, the value of the attribute can change over time. Inputs control a specific value and are exported through the control interfaces.
#[tokio::main]
async fn main() -> Result<()> {
let mut scene = Scene::new();
let rate_input = scene.input::<f32>("rate")?;
let color_input = scene.input::<Range<Rgb>>("color")?;
let base = scene.node("raindrops", Raindrops {
rate: rate_input.attr(0.3),
decay: (0.96, 0.98).fixed(),
color: color_input
.attr(Range(Hsl::new(187.5, 0.25, 0.5).into_color(), Hsl::new(223.92, 0.5, 0.5).into_color()))
.map(|v| v.map(Hsl::from_color)),
})?;
let brightness_input = scene.input::<f32>("brightness")?;
let brightness = scene.node("brightness", Brightness {
value: brightness_input.attr(1.0),
source: base,
range: None,
})?;
let output = Terminal::new(80)
.with_path("/tmp/Photonic")
.with_waterfall(true);
let mut scene = scene.run(brightness, output).await?;
let cli = Photonic_interface_cli::stdio::CLI;
scene.serve("CLI", cli);
return Ok(scene.run(60).await?);
}
We welcome contributions from the community to help improve Photonic. Whether you're a developer, designer, or enthusiast, there are many ways to get involved:
Photonic is licensed under the MIT License, which means you are free to use, modify, and distribute the software for both commercial and non-commercial purposes. See the LICENSE file for more details.
If you have any questions, concerns, or feedback about Photonic, please contact us or open an issue on the project's GitHub repository.
We would like to thank all contributors and supporters who have helped make Photonic possible. Your contributions and feedback are greatly appreciated!