diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/sway/commands.c b/sway/commands.c index e7f1eafe..751dbe9c 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -567,34 +567,3 @@ char *cmd_results_to_json(list_t *res_list) { json_object_put(result_array); return res; } - -/** - * Check and add color to buffer. - * - * return error object, or NULL if color is valid. - */ -struct cmd_results *add_color(char *buffer, const char *color) { - int len = strlen(color); - if (len != 7 && len != 9) { - return cmd_results_new(CMD_INVALID, - "Invalid color definition %s", color); - } - if (color[0] != '#') { - return cmd_results_new(CMD_INVALID, - "Invalid color definition %s", color); - } - for (int i = 1; i < len; ++i) { - if (!isxdigit(color[i])) { - return cmd_results_new(CMD_INVALID, - "Invalid color definition %s", color); - } - } - strcpy(buffer, color); - // add default alpha channel if color was defined without it - if (len == 7) { - buffer[7] = 'f'; - buffer[8] = 'f'; - } - buffer[9] = '\0'; - return NULL; -} |