X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=theme.cpp;h=aefc081e97847d9349079fcc502d1e9161f1cd90;hb=f006b5b162841dbc764fb620025b87a3272ac79a;hp=35b777e76d79c6ea3afe309e57b0ae5333be9b2e;hpb=bd7755947b1c46f046cb9ddcff5bcfbf2d151fa1;p=nageru diff --git a/theme.cpp b/theme.cpp index 35b777e..aefc081 100644 --- a/theme.cpp +++ b/theme.cpp @@ -810,6 +810,22 @@ int Theme::get_channel_signal(unsigned channel) return ret; } +std::string Theme::get_channel_color(unsigned channel) +{ + unique_lock lock(m); + lua_getglobal(L, "channel_color"); + lua_pushnumber(L, channel); + if (lua_pcall(L, 1, 1, 0) != 0) { + fprintf(stderr, "error running function `channel_color': %s\n", lua_tostring(L, -1)); + exit(1); + } + + std::string ret = checkstdstring(L, -1); + lua_pop(L, 1); + assert(lua_gettop(L) == 0); + return ret; +} + bool Theme::get_supports_set_wb(unsigned channel) { unique_lock lock(m);