diff --git a/skembo/Skembo.cpp b/skembo/Skembo.cpp index 4afad8f..27ba824 100644 --- a/skembo/Skembo.cpp +++ b/skembo/Skembo.cpp @@ -32,22 +32,28 @@ void Skembo::setup(cairo_t* context, const cairo_rectangle_t& rect) { } int Skembo::fps() const { - return 20; + return 40; } void Skembo::draw_frame() { - // std::uniform_real_distribution dist {}; + // next color HSB hsb; hsb.h = _hue; - hsb.s = 1;//dist(_eng); - hsb.b = 0.4;//dist(_eng); + hsb.s = 1.0; + hsb.b = 0.4; + + // convert to rgb Color color {hsb}; RGB rgb {RGB(color)}; + + // setup color, fill whole window cairo_set_source_rgb(_c, rgb.r, rgb.g, rgb.b); cairo_rectangle(_c, _r.x, _r.y, _r.width, _r.height); cairo_fill(_c); - _hue += 1.0; + + // update for next frame + _hue += 0.5; if (_hue > 360.0) { - _hue = 0.0; + _hue -= 360.0; } }