mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
pre generate grayscale palettes
This commit is contained in:
parent
cfa3cad5cb
commit
ee28d431bd
7 changed files with 16 additions and 12 deletions
|
|
@ -73,6 +73,14 @@ impl ItemColor {
|
|||
pub darkest: ItemColor,
|
||||
}
|
||||
impl ItemPalette {
|
||||
pub const G: [Self;256] = {
|
||||
let mut builder = konst::ArrayBuilder::new();
|
||||
let mut index = 0;
|
||||
while !builder.is_full() {
|
||||
builder.push(ItemPalette::G[index]);
|
||||
index++;
|
||||
}
|
||||
};
|
||||
pub fn random () -> Self { ItemColor::random().into() }
|
||||
pub fn random_near (color: Self, distance: f32) -> Self {
|
||||
color.base.mix(ItemColor::random(), distance).into()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue