diff options
author | Robin Gareus <robin@gareus.org> | 2017-02-18 16:11:18 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-02-18 16:11:18 +0100 |
commit | 4755c703f4b01cd7de01bda0c72686b93e34e120 (patch) | |
tree | b9730e049e820087b96c909a3f318eab8f8df102 /libs/ardour/ardour/lua_api.h | |
parent | c40ccd5aaeb6e1c6ffd7f7685567444a26ded76f (diff) |
move color_to_rgba to LuaAPI for consistency
Diffstat (limited to 'libs/ardour/ardour/lua_api.h')
-rw-r--r-- | libs/ardour/ardour/lua_api.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/ardour/ardour/lua_api.h b/libs/ardour/ardour/lua_api.h index c5ce0986ce..cbbe750164 100644 --- a/libs/ardour/ardour/lua_api.h +++ b/libs/ardour/ardour/lua_api.h @@ -167,6 +167,22 @@ namespace ARDOUR { namespace LuaAPI { int hsla_to_rgba (lua_State *lua); /** + * A convenience function to expand RGBA parameters from an integer + * + * convert a Canvas::Color (uint32_t 0xRRGGBBAA) into + * double RGBA values which can be passed as parameters to + * Cairo::Context::set_source_rgba + * + * Example: + * @code + * local r, g, b, a = ARDOUR.LuaAPI.color_to_rgba (0x88aa44ff) + * cairo_ctx:set_source_rgba (ARDOUR.LuaAPI.color_to_rgba (0x11336699) + * @endcode + * @returns 4 parameters: red, green, blue, alpha (in range 0..1) + */ + int color_to_rgba (lua_State *lua); + + /** * Creates a filename from a series of elements using the correct separator for filenames. * * No attempt is made to force the resulting filename to be an absolute path. |