20#ifndef HEDGEHOG_BLUE_TO_RED_COLOR_H
21#define HEDGEHOG_BLUE_TO_RED_COLOR_H
47 std::chrono::nanoseconds
const &min,
48 std::chrono::nanoseconds
const &range)
override {
50 auto posRedToBlue = (uint64_t) std::round((
double) (value.count() - min.count()) / (
double) range.count() * 255);
51 posRedToBlue = std::clamp(posRedToBlue, (uint64_t) 0, (uint64_t) 255);
54 << std::setfill(
'0') << std::setw(2) << std::hex << posRedToBlue
56 << std::setfill(
'0') << std::setw(2) << std::hex << 255 - posRedToBlue
std::string getRGBFromRange(std::chrono::nanoseconds const &value, std::chrono::nanoseconds const &min, std::chrono::nanoseconds const &range) override
Return a color from only blue to only red, blue being the lowest value, red the highest value in rang...
~BlueToRedColor() override=default
Default destructor.
BlueToRedColor()=default
Default constructor.
Color scheme abstraction for dot file generation.