mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
add Gtkmm2ext::random_color()
This commit is contained in:
parent
ab5af01007
commit
79b12f82eb
2 changed files with 9 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue