add Gtkmm2ext::random_color()
This commit is contained in:
parent
a3039d3895
commit
fc25e074ac
@ -21,6 +21,7 @@
|
||||
#include <cmath>
|
||||
#include <stdint.h>
|
||||
#include <cfloat>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "pbd/failed_constructor.h"
|
||||
#include "pbd/string_convert.h"
|
||||
@ -698,3 +699,9 @@ Gtkmm2ext::set_source_rgb_a (cairo_t *cr, Color color, float alpha)
|
||||
alpha
|
||||
);
|
||||
}
|
||||
|
||||
Color
|
||||
Gtkmm2ext::random_color ()
|
||||
{
|
||||
return ((random() % 16777215) << 8 | 0xff);
|
||||
}
|
||||
|
@ -31,6 +31,8 @@ namespace Gtkmm2ext
|
||||
|
||||
typedef uint32_t Color;
|
||||
|
||||
extern LIBGTKMM2EXT_API Color random_color ();
|
||||
|
||||
/* conventient way to use Gtkmm2ext::Color with libcairo */
|
||||
extern LIBGTKMM2EXT_API void set_source_rgba (Cairo::RefPtr<Cairo::Context>, Gtkmm2ext::Color);
|
||||
extern LIBGTKMM2EXT_API void set_source_rgb_a (Cairo::RefPtr<Cairo::Context>, Gtkmm2ext::Color, float alpha); //override the color's alpha
|
||||
|
Loading…
Reference in New Issue
Block a user