| Crates.io | bevygen |
| lib.rs | bevygen |
| version | 0.1.0 |
| created_at | 2025-04-09 02:58:52.110455+00 |
| updated_at | 2025-04-09 12:12:19.019744+00 |
| description | parked: opinionated bevy game design cli |
| homepage | |
| repository | https://github.com/dsgallups/bevygen |
| max_upload_size | |
| id | 1626228 |
| size | 81,730 |
A cli tool and library to scaffold boilerplate for your bevy project
This crate is currently being worked on. This crate is an extension of the cargo-color-gen CLI tool.
install via cargo install bevygen
Then, with a tailwind scheme and output file:
bevygen color -i examples/example.json -o example_output/coloors_output.rs
See the color generation docs for details
A schema that looks something like this.
{
"sandy_brown": {
"100": "#462001",
"600": "#fdbc87",
"900": "#feeee1"
},
"redwood": {
"700": "#d58a8792", // alpha channel included
"800": "#e3b1af",
"900": "#f1d8d7",
"NO_WORK": "#GGGGGG" // generated file will state this has failed
}
}
Additionally, it can be a JS object and this cli will attempt to reformat it as a JSON.
You can specify a JSON file with the -i parameter, or paste your json as a single line.
Pretty-printed JSONs through -stdin will fail. This may need some work.
This CLI was built with the intention of supporting the - Tailwind Export of coolors.co.
This is a good starting point for working with your palettes!
If there is a need for quickly switching between palettes (as opposed to the current constant colors generated), please let me know!
The above input will generate the following:
/// Generated using `color-gen` v0.2
use bevy::color::Color;
///Original hex: #462001
pub const SANDY_BROWN_100: Color = Color::srgb(
0.27450982f32,
0.1254902f32,
0.003921569f32,
);
///Original hex: #fdbc87
pub const SANDY_BROWN_600: Color = Color::srgb(
0.99215686f32,
0.7372549f32,
0.5294118f32,
);
///Original hex: #feeee1
pub const SANDY_BROWN_900: Color = Color::srgb(
0.99607843f32,
0.93333334f32,
0.88235295f32,
);
///Original hex: #e3b1af
pub const REDWOOD_800: Color = Color::srgb(0.8901961f32, 0.69411767f32, 0.6862745f32);
///Original hex: #f1d8d7
pub const REDWOOD_900: Color = Color::srgb(0.94509804f32, 0.84705883f32, 0.84313726f32);
///Original hex: #d58a8792
pub const REDWOOD_700: Color = Color::srgba(
0.8352941f32,
0.5411765f32,
0.5294118f32,
0.57254905f32,
);
/**Error parsing hex #GGGGGG
r: Err(ParseIntError { kind: InvalidDigit })
g: Err(ParseIntError { kind: InvalidDigit })
b: Err(ParseIntError { kind: InvalidDigit })*/
pub const REDWOOD_NO_WORK: () = ();
If you specify an output -o, the output will save to that file. Otherwise, it will be printed to stdout.
I would love to know about bevy code that you think requires a lot of boilerplate. Please let me know what you find.
bevygen color