Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
+#include <ctype.h>
#include "smartcolsP.h"
if (!ce)
return -EINVAL;
if (color) {
+ if (isalnum(*color)) {
+ color = colorscheme_from_string(color);
+
+ if (!color)
+ return -EINVAL;
+ }
p = strdup(color);
if (!p)
return -ENOMEM;
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
+#include <ctype.h>
#include "smartcolsP.h"
if (!cl)
return -EINVAL;
if (color) {
+ if (isalnum(*color)) {
+ color = colorscheme_from_string(color);
+
+ if (!color)
+ return -EINVAL;
+ }
p = strdup(color);
if (!p)
return -ENOMEM;
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
+#include <ctype.h>
#include "smartcolsP.h"
if (!ln)
return -EINVAL;
if (color) {
+ if (isalnum(*color)) {
+ color = colorscheme_from_string(color);
+
+ if (!color)
+ return -EINVAL;
+ }
p = strdup(color);
if (!p)
return -ENOMEM;
struct libscols_cell *h = scols_column_get_header(cl);
scols_column_set_color(cl, UL_COLOR_BOLD_GREEN);
- scols_cell_set_color(h, UL_COLOR_GREEN);
+ scols_cell_set_color(h, "green"); /* a human-readable string is also legal */
}
scols_table_new_column(tb, "BAR", 0.3);
scols_table_new_column(tb, "PATH", 0.3);