| Crates.io | bevy-color-palettes |
| lib.rs | bevy-color-palettes |
| version | 0.2.0-alpha.1 |
| created_at | 2026-01-18 08:59:17.412448+00 |
| updated_at | 2026-01-23 23:09:25.846815+00 |
| description | Color palettes for Bevy and egui, with macros for compile-time palette definitions, based on weirdboi_bevy_colour. |
| homepage | https://weirdboi.dev/libraries/bevy-colours |
| repository | https://github.com/AmyGilhespy/bevy-color-palettes |
| max_upload_size | |
| id | 2052077 |
| size | 165,823 |
This is a fork of weirdboi_bevy_colour which adds more pre-defined palettes that I needed for my own projects. It is currently in early development.
| version | bevy |
|---|---|
| 0.2 | 0.18 |
| 0.1 | 0.17 |
This project is based on work originally published at: https://weirdboi.dev/libraries/bevy-colours
Licensed under the Apache License, Version 2.0.
This fork significantly expands the available palettes and is independently maintained.
A Rust library providing a collection of popular colour palettes for the Bevy game engine, with utilities for interacting with them.
Create colour palettes: Create flexible colour palettes with the palette! macro
Pre-defined Colour Palettes: Includes several popular colour palettes from Lospec:
Visual Documentation: Each palette includes custom HTML when generating a Rustdoc to showcase the available colours. Integrates nicely with IDE doc previews
Add this to your Cargo.toml:
[dependencies]
bevy-color-palettes = { git = "https://github.com/AmyGilhespy/bevy-color-palettes", branch = "main" }
use bevy::prelude::*;
use bevy_color_palettes::Dawnbringer16;
fn setup(mut commands: Commands) {
let mut x = 0.0;
// Spawn a coloured square for each colour in the palette
for color in &Dawnbringer16 {
commands.spawn((
Sprite {
color,
custom_size: Some(Vec2::new(40.0, 40.0)),
..default()
},
Transform::from_xyz(x, 0.0, 0.0)
));
x += 50.0;
}
}
You can create your own colour palettes using the palette! macro:
use bevy_color_palettes::palette;
palette!(MyGamePalette {
"hero": (0.2, 0.6, 0.9),
"enemy": (0.9, 0.2, 0.3),
"background": (0.1, 0.1, 0.2),
"highlight": (1.0, 0.8, 0.0),
});
// Now you can use your palette just like the built-in ones:
let hero_colour = MyGamePalette::HERO;
let enemy_colour = MyGamePalette::enemy();
let bg_colour = MyGamePalette::get("BaCKgrouND").unwrap();
// Iterate over all colours
for colour in &MyGamePalette {
// Use colour...
}