diff --git a/huey/Huey.cpp b/huey/Huey.cpp index 14c4759..45bee3f 100644 --- a/huey/Huey.cpp +++ b/huey/Huey.cpp @@ -9,6 +9,8 @@ #include "Huey.hpp" #include #include +#include +#include class Huey : public ScreensaverPlugin { public: @@ -47,18 +49,27 @@ void Huey::draw_frame() { cairo_fill(_c); // show hue value - std::string hue_text {std::to_string(static_cast(_hue))}; + std::ostringstream hue_oss; + hue_oss << "hue: " << std::setw(5) << std::setprecision(4) << _hue; + std::ostringstream rgb_oss; + rgb_oss << "red: " << std::setw(3) << static_cast(255 * rgb.r); + rgb_oss << ", green: " << std::setw(3) << static_cast(255 * rgb.g); + rgb_oss << ", blue: " << std::setw(3) << static_cast(255 * rgb.b); cairo_set_source_rgb(_c, 0, 0, 0); cairo_select_font_face(_c, "Helvetica", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(_c, 24); - cairo_move_to(_c, 30, 50); - cairo_show_text(_c, hue_text.c_str()); + cairo_move_to(_c, 31, 51); + cairo_show_text(_c, hue_oss.str().c_str()); + cairo_move_to(_c, 31, 87); + cairo_show_text(_c, rgb_oss.str().c_str()); cairo_set_source_rgb(_c, 1, 1, 1); cairo_move_to(_c, 29, 49); - cairo_show_text(_c, hue_text.c_str()); + cairo_show_text(_c, hue_oss.str().c_str()); + cairo_move_to(_c, 29, 85); + cairo_show_text(_c, rgb_oss.str().c_str()); // update for next frame - _hue += 0.5; + _hue += 0.1; if (_hue >= 360.0) { _hue -= 360.0; }