mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 06:16:40 +02:00
Added plugin API function to get IRC color number by name
This commit is contained in:
@@ -1090,3 +1090,25 @@ weechat_plugin_input_color (t_weechat_plugin *plugin, int color, int start, int
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_plugin_get_irc_color: get number of IRC color name
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_plugin_get_irc_color (t_weechat_plugin *plugin, char *color_name)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!plugin)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < GUI_NUM_IRC_COLORS; i++)
|
||||
{
|
||||
if (strcasecmp (plugins_irc_colors[i].name, color_name) == 0)
|
||||
return i;
|
||||
}
|
||||
|
||||
/* color not found */
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user