From 7c7a78898a662a7d9936eaf1cd36289576cbe2e3 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Mon, 12 Mar 2018 09:12:48 -0700 Subject: [PATCH] glib: Add guarantee-color. --- src/glib/glib.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/glib/glib.scm b/src/glib/glib.scm index 252fa0580..1fbdd0b9f 100644 --- a/src/glib/glib.scm +++ b/src/glib/glib.scm @@ -114,6 +114,11 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (set-color-blue! color blue) (set-color-alpha! color alpha) color)) + +(define (guarantee-color object operator) + (if (color? object) + object + (error:wrong-type-argument object "a color" operator))) ;;; GLib Mutex -- 2.25.1