xparsecolor.h (1653B)
1/* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 20#ifndef GUAC_TERMINAL_XPARSECOLOR_H 21#define GUAC_TERMINAL_XPARSECOLOR_H 22 23/** 24 * Function definitions related to handling X11 color specs. 25 * 26 * @file xparsecolor.h 27 */ 28 29 30#include "palette.h" 31 32/** 33 * Parses an X11 color spec, as defined by Xlib's XParseColor(), storing the 34 * result in the provided guac_terminal_color structure. If the color spec is 35 * not valid, the provided guac_terminal_color is not touched. 36 * 37 * Currently, only the "rgb:*" format color specs are supported. 38 * 39 * @param spec 40 * The X11 color spec to parse. 41 * 42 * @param color 43 * A pointer to the guac_terminal_color structure which should receive the 44 * parsed result. 45 * 46 * @returns 47 * Zero if the color spec was successfully parsed, non-zero otherwise. 48 */ 49int guac_terminal_xparsecolor(const char* spec, 50 guac_terminal_color* color); 51 52#endif 53