summaryrefslogtreecommitdiff
path: root/libavutil/parseutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavutil/parseutils.c')
-rw-r--r--libavutil/parseutils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 1e1b93e8e5..e793e2d4c6 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -420,6 +420,20 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
return 0;
}
+const char *av_get_known_color_name(int color_idx, const uint8_t **rgbp)
+{
+ const ColorEntry *color;
+
+ if ((unsigned)color_idx >= FF_ARRAY_ELEMS(color_table))
+ return NULL;
+
+ color = &color_table[color_idx];
+ if (rgbp)
+ *rgbp = color->rgb_color;
+
+ return color->name;
+}
+
/* get a positive number between n_min and n_max, for a maximum length
of len_max. Return -1 if error. */
static int date_get_num(const char **pp,