better color editor
This commit is contained in:
@@ -4,6 +4,8 @@ mod board;
|
||||
mod builtin_scripts;
|
||||
/// CP437 tile-index → character mapping ([`cp437::tile_to_char`]) for the default font.
|
||||
pub mod cp437;
|
||||
/// The 16 EGA/VGA named colors ([`colors::NAMED_COLORS`]), shared by scripts and the editor.
|
||||
pub mod colors;
|
||||
/// Procedural floor generators ([`floor::FloorGenerator`]).
|
||||
pub mod floor;
|
||||
/// Core game types: [`board::Board`], [`glyph::Glyph`], [`archetype::Archetype`], etc.
|
||||
|
||||
+5
-17
@@ -1021,23 +1021,11 @@ fn register_global_constants(engine: &mut Engine) {
|
||||
m.set_var("South", Direction::South);
|
||||
m.set_var("East", Direction::East);
|
||||
m.set_var("West", Direction::West);
|
||||
// 16 EGA/VGA color constants as "#RRGGBB" strings.
|
||||
m.set_var("Black", "#000000");
|
||||
m.set_var("Blue", "#0000AA");
|
||||
m.set_var("Green", "#00AA00");
|
||||
m.set_var("Cyan", "#00AAAA");
|
||||
m.set_var("Red", "#AA0000");
|
||||
m.set_var("Magenta", "#AA00AA");
|
||||
m.set_var("Brown", "#AA5500");
|
||||
m.set_var("LightGray", "#AAAAAA");
|
||||
m.set_var("DarkGray", "#555555");
|
||||
m.set_var("BrightBlue", "#5555FF");
|
||||
m.set_var("BrightGreen", "#55FF55");
|
||||
m.set_var("BrightCyan", "#55FFFF");
|
||||
m.set_var("BrightRed", "#FF5555");
|
||||
m.set_var("BrightMagenta", "#FF55FF");
|
||||
m.set_var("Yellow", "#FFFF55");
|
||||
m.set_var("White", "#FFFFFF");
|
||||
// 16 EGA/VGA color constants as "#RRGGBB" strings, from the shared palette table
|
||||
// (the single source of truth, also used by the editor's color picker).
|
||||
for (name, c) in crate::colors::NAMED_COLORS {
|
||||
m.set_var(name, format!("#{:02X}{:02X}{:02X}", c.r, c.g, c.b));
|
||||
}
|
||||
engine.register_global_module(m.into());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user