Hopson97 / Asciimon

Pokemon-inspired game created using Rust for terminals which support ANSI escape commands.
124 stars 11 forks source link

Use constants for colours #13

Closed dmitmel closed 6 years ago

dmitmel commented 6 years ago

I've also defined a macro called define_colour, it can be used like this:

// The colour struct should be available in the current scope for this macro to work!
use graphics::colour::Colour;
define_colour!(SOMETHING, 1, 2, 3);

And it will generate the following code:

const SOMETHING: Colour = Colour { r: 1, g: 2, b: 3 };
dmitmel commented 6 years ago

@Hopson97 I'll rebase this branch onto master

dmitmel commented 6 years ago

@Hopson97 Done, this branch now can be safely merged