mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
add ArdourCanvas::change_alpha()
Time to move away from rgba macros
This commit is contained in:
parent
55d91f71e0
commit
a494211e73
2 changed files with 8 additions and 0 deletions
|
|
@ -31,6 +31,8 @@ namespace ArdourCanvas
|
||||||
struct LIBCANVAS_API HSV;
|
struct LIBCANVAS_API HSV;
|
||||||
struct LIBCANVAS_API HSVA;
|
struct LIBCANVAS_API HSVA;
|
||||||
|
|
||||||
|
extern LIBCANVAS_API Color change_alpha (Color, double alpha);
|
||||||
|
|
||||||
extern LIBCANVAS_API Color hsva_to_color (double h, double s, double v, double a = 1.0);
|
extern LIBCANVAS_API Color hsva_to_color (double h, double s, double v, double a = 1.0);
|
||||||
extern LIBCANVAS_API void color_to_hsva (Color color, double& h, double& s, double& v, double& a);
|
extern LIBCANVAS_API void color_to_hsva (Color color, double& h, double& s, double& v, double& a);
|
||||||
extern LIBCANVAS_API void color_to_hsv (Color color, double& h, double& s, double& v);
|
extern LIBCANVAS_API void color_to_hsv (Color color, double& h, double& s, double& v);
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,12 @@ using namespace ArdourCanvas;
|
||||||
using std::max;
|
using std::max;
|
||||||
using std::min;
|
using std::min;
|
||||||
|
|
||||||
|
ArdourCanvas::Color
|
||||||
|
change_alpha (Color c, double a)
|
||||||
|
{
|
||||||
|
return ((c & ~0xff) | (lrintf (a*255.0) & 0xff));
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ArdourCanvas::color_to_hsv (Color color, double& h, double& s, double& v)
|
ArdourCanvas::color_to_hsv (Color color, double& h, double& s, double& v)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue