Hopson97 / Asciimon

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

Add 256 colour support #11

Closed Astrid-Lauen closed 6 years ago

Astrid-Lauen commented 6 years ago

This pull request adds 256 colour support that can be enabled by compiling with cargo run --features 256colour. 256 colour support is useful for terminals without 24 bit colour support such as the macOS terminal.

This pull request also refactors part of the code by replacing the static methods Colour::ansi_text_colour_string and Colour::ansi_bg_colour_string with instance methods to make code cleaner.

Astrid-Lauen commented 6 years ago

Here is what the game looks like with 24 bit colour (first image) and 256 colour (second image) on a terminal without 24 bit colour support:

before after
dmitmel commented 6 years ago

Whoops, I've approved the wrong commit

Hopson97 commented 6 years ago

Looks good, thanks!