Coverage decorator (#384)

Add code coverage for colors and decorators.
This commit is contained in:
Arthur Sonzogni
2022-04-26 17:04:34 +02:00
committed by GitHub
parent 764c24ef40
commit 04b36df567
14 changed files with 410 additions and 12 deletions

View File

@@ -53,12 +53,12 @@ std::string Color::Print(bool is_background_color) const {
return (is_background_color ? "48;5;"s : "38;5;"s) + std::to_string(red_);
case ColorType::TrueColor:
default:
return (is_background_color ? "48;2;"s : "38;2;"s) //
+ std::to_string(red_) + ";" //
+ std::to_string(green_) + ";" //
+ std::to_string(blue_); //
}
return "";
}
/// @brief Build a transparent color.
@@ -96,7 +96,7 @@ Color::Color(uint8_t red, uint8_t green, uint8_t blue)
return;
}
// Find the closest coor from the database:
// Find the closest Color from the database:
const int max_distance = 256 * 256 * 3;
int closest = max_distance;
int best = 0;