From 24d802abc5be46b148e82b06ffb916fd878e70c0 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig Date: Mon, 4 Jun 2018 17:12:05 +0200 Subject: [PATCH] uiAttributeBackground --- common/attribute.c | 5 +++++ ui.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/common/attribute.c b/common/attribute.c index 4a8f0160..1289528a 100644 --- a/common/attribute.c +++ b/common/attribute.c @@ -183,6 +183,11 @@ uiAttribute *uiNewBackgroundAttribute(double r, double g, double b, double a) return at; } +void uiAttributeBackground(const uiAttribute *a, double *r, double *g, double *b, double *alpha) +{ + uiAttributeColor(a, r, g, b, alpha); +} + uiAttribute *uiNewUnderlineAttribute(uiUnderline u) { uiAttribute *a; diff --git a/ui.h b/ui.h index b5fb9a27..22d8eeff 100644 --- a/ui.h +++ b/ui.h @@ -664,6 +664,10 @@ _UI_EXTERN void uiAttributeColor(const uiAttribute *a, double *r, double *g, dou // error to specify an invalid color. _UI_EXTERN uiAttribute *uiNewBackgroundAttribute(double r, double g, double b, double a); +// uiAttributeBackground() returns the background color stored in a. It is an +// error to call this on a uiAttribute that does not hold a background color. +_UI_EXTERN void uiAttributeBackground(const uiAttribute *a, double *r, double *g, double *b, double *alpha); + // TODO reuse uiAttributeColor() for background colors, or make a new function... // uiUnderline specifies a type of underline to use on text.