From 7a0525c50663139c92fb9c45397be29e1ebb350d Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Mon, 13 Dec 2021 12:52:42 +0100 Subject: [PATCH] Adapted to use new iomanipulators for effects --- progress.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/progress.cpp b/progress.cpp index a43ce80..da156ce 100644 --- a/progress.cpp +++ b/progress.cpp @@ -25,38 +25,32 @@ void show_hue_bar(const sc::term& t, int top) { int b = 0; // red -> yellow while (g <= top) { - t.rgbb(r, g++, b); - std::cerr << ' '; + std::cerr << sc::io::rgbb(r, g++, b) << ' '; } g = top; // yellow -> green while (r >= 0) { - t.rgbb(r--, g, b); - std::cerr << ' '; + std::cerr << sc::io::rgbb(r--, g, b) << ' '; } r = 0; // green -> cyan while (b < 6) { - t.rgbb(r, g, b++); - std::cerr << ' '; + std::cerr << sc::io::rgbb(r, g, b++) << ' '; } b = top; // cyan -> blue while (g >= 0) { - t.rgbb(r, g--, b); - std::cerr << ' '; + std::cerr << sc::io::rgbb(r, g--, b) << ' '; } g = 0; // blue -> magenta while (r <= top) { - t.rgbb(r++, g, b); - std::cerr << ' '; + std::cerr << sc::io::rgbb(r++, g, b) << ' '; } r = top; // magenta -> red while (b >= 0) { - t.rgbb(r, g, b--); - std::cerr << ' '; + std::cerr << sc::io::rgbb(r, g, b--) << ' '; } t.reset(); std::cerr << std::endl; @@ -70,8 +64,7 @@ void show_hue_bars(const sc::term& t) { void show_grayscale_bar(const sc::term& t) { for (int i = 0; i < 23; ++i) { - t.grayb(i); - std::cerr << ' '; + std::cerr << sc::io::grayb(i) << ' '; } t.reset(); std::cerr << std::endl;