Fluid containers
This commit is contained in:
@@ -30,6 +30,11 @@ export function is_tint_color(value: unknown): value is TintColor {
|
||||
(typeof value === "string" && /^#[0-9a-fA-F]{6}$/.test(value));
|
||||
}
|
||||
|
||||
// a color like 0x80a755 as red, green and blue from 0 to 1, for drawing
|
||||
export function color_rgb(color: number): [number, number, number] {
|
||||
return [(color >> 16) / 255, ((color >> 8) & 0xff) / 255, (color & 0xff) / 255];
|
||||
}
|
||||
|
||||
// the color outside any biome, for items: the default grass, foliage or water color, or the fixed one
|
||||
export function tint_without_biome(color: TintColor) {
|
||||
if (color === "grass") return DEFAULT_GRASS_COLOR;
|
||||
|
||||
Reference in New Issue
Block a user