diff --git a/huey/Huey.cpp b/huey/Huey.cpp index b7c6e07..14c4759 100644 --- a/huey/Huey.cpp +++ b/huey/Huey.cpp @@ -8,6 +8,7 @@ #include "Huey.hpp" #include +#include class Huey : public ScreensaverPlugin { public: @@ -45,9 +46,20 @@ void Huey::draw_frame() { cairo_rectangle(_c, _r.x, _r.y, _r.width, _r.height); cairo_fill(_c); + // show hue value + std::string hue_text {std::to_string(static_cast(_hue))}; + 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_set_source_rgb(_c, 1, 1, 1); + cairo_move_to(_c, 29, 49); + cairo_show_text(_c, hue_text.c_str()); + // update for next frame _hue += 0.5; - if (_hue > 360.0) { + if (_hue >= 360.0) { _hue -= 360.0; } }