#include <stdio.h>
#include <string.h>
#include "cr-rgb.h"
#include "cr-term.h"
#include "cr-parser.h"
Go to the source code of this file.
Functions | |
CRRgb * | cr_rgb_new (void) |
The default constructor of CRRgb. | |
CRRgb * | cr_rgb_new_with_vals (gulong a_red, gulong a_green, gulong a_blue, gboolean a_is_percentage) |
A constructor of CRRgb. | |
guchar * | cr_rgb_to_string (CRRgb *a_this) |
Serializes the rgb into a zero terminated string. | |
void | cr_rgb_dump (CRRgb *a_this, FILE *a_fp) |
Dumps the current instance of CRRgb to a file. | |
enum CRStatus | cr_rgb_compute_from_percentage (CRRgb *a_this) |
If the rgb values are expressed in percentage, compute their real value. | |
enum CRStatus | cr_rgb_set (CRRgb *a_this, gulong a_red, gulong a_green, gulong a_blue, gboolean a_is_percentage) |
Sets rgb values to the RGB. | |
enum CRStatus | cr_rgb_set_to_inherit (CRRgb *a_this, gboolean a_inherit) |
sets the value of the rgb to inherit. | |
gboolean | cr_rgb_is_set_to_inherit (CRRgb *a_this) |
gboolean | cr_rgb_is_set_to_transparent (CRRgb *a_this) |
Tests if the the rgb is set to the value "transparent" or not. | |
enum CRStatus | cr_rgb_set_to_transparent (CRRgb *a_this, gboolean a_is_transparent) |
Sets the rgb to the "transparent" value (or not). | |
enum CRStatus | cr_rgb_set_from_rgb (CRRgb *a_this, CRRgb *a_rgb) |
Sets the rgb from an other one. | |
enum CRStatus | cr_rgb_set_from_name (CRRgb *a_this, const guchar *a_color_name) |
enum CRStatus | cr_rgb_set_from_hex_str (CRRgb *a_this, const guchar *a_hex) |
enum CRStatus | cr_rgb_set_from_term (CRRgb *a_this, const struct _CRTerm *a_value) |
Set the rgb from a terminal symbol. | |
enum CRStatus | cr_rgb_copy (CRRgb *a_dest, CRRgb *a_src) |
void | cr_rgb_destroy (CRRgb *a_this) |
Destructor of CRRgb. | |
CRRgb * | cr_rgb_parse_from_buf (const guchar *a_str, enum CREncoding a_enc) |
Parses a text buffer that contains a rgb color. |
|
If the rgb values are expressed in percentage, compute their real value.
Definition at line 303 of file cr-rgb.c. References _CRRgb::blue, CR_BAD_PARAM_ERROR, _CRRgb::green, _CRRgb::is_percentage, and _CRRgb::red. |
|
Definition at line 551 of file cr-rgb.c. References CR_BAD_PARAM_ERROR, and CRRgb. Referenced by cr_rgb_set_from_rgb(), and cr_style_resolve_inherited_properties(). |
|
Destructor of CRRgb.
|
|
Dumps the current instance of CRRgb to a file.
Definition at line 281 of file cr-rgb.c. References cr_rgb_to_string(). |
|
Definition at line 364 of file cr-rgb.c. References CR_BAD_PARAM_ERROR, and _CRRgb::inherit. Referenced by cr_style_resolve_inherited_properties(). |
|
Tests if the the rgb is set to the value "transparent" or not.
Definition at line 380 of file cr-rgb.c. References _CRRgb::is_transparent. |
|
The default constructor of CRRgb.
Definition at line 187 of file cr-rgb.c. References cr_utils_trace_info, and CRRgb. Referenced by cr_rgb_new_with_vals(), and cr_rgb_parse_from_buf(). |
|
A constructor of CRRgb.
Definition at line 213 of file cr-rgb.c. References _CRRgb::blue, cr_rgb_new(), CRRgb, _CRRgb::green, _CRRgb::is_percentage, and _CRRgb::red. |
|
Parses a text buffer that contains a rgb color.
Definition at line 579 of file cr-rgb.c. References cr_parser_destroy(), cr_parser_new_from_buf(), cr_parser_parse_term(), cr_parser_try_to_skip_spaces_and_comments(), cr_rgb_new(), cr_rgb_set_from_term(), cr_term_destroy(), CRParser, CRRgb, CRStatus, and CRTerm. |
|
Sets rgb values to the RGB.
Definition at line 326 of file cr-rgb.c. References _CRRgb::blue, CR_BAD_PARAM_ERROR, _CRRgb::green, _CRRgb::inherit, _CRRgb::is_percentage, _CRRgb::is_transparent, and _CRRgb::red. Referenced by cr_rgb_set_from_hex_str(), cr_style_set_props_to_default_values(), and cr_style_set_props_to_initial_values(). |
|
Definition at line 441 of file cr-rgb.c. References CR_BAD_PARAM_ERROR, cr_rgb_set(), cr_rgb_set_to_transparent(), and CRStatus. Referenced by cr_rgb_set_from_term(). |
|
Definition at line 418 of file cr-rgb.c. References CR_BAD_PARAM_ERROR, cr_rgb_set_from_rgb(), CRStatus, and name. Referenced by cr_rgb_set_from_term(). |
|
Sets the rgb from an other one.
Definition at line 408 of file cr-rgb.c. References CR_BAD_PARAM_ERROR, and cr_rgb_copy(). Referenced by cr_rgb_set_from_name(), and cr_rgb_set_from_term(). |
|
Set the rgb from a terminal symbol.
Definition at line 500 of file cr-rgb.c. References CR_BAD_PARAM_ERROR, cr_rgb_set_from_hex_str(), cr_rgb_set_from_name(), cr_rgb_set_from_rgb(), cr_utils_trace_info, CRStatus, _CRRgb::inherit, _CRRgb::is_transparent, TERM_HASH, TERM_IDENT, and TERM_RGB. Referenced by cr_rgb_parse_from_buf(). |
|
sets the value of the rgb to inherit. Look at the css spec from chapter 6.1 to 6.2 to understand the meaning of "inherit".
Definition at line 354 of file cr-rgb.c. References CR_BAD_PARAM_ERROR, and _CRRgb::inherit. Referenced by cr_style_set_props_to_default_values(). |
|
Sets the rgb to the "transparent" value (or not).
Definition at line 393 of file cr-rgb.c. References CR_BAD_PARAM_ERROR, and _CRRgb::is_transparent. Referenced by cr_rgb_set_from_hex_str(), cr_style_set_props_to_default_values(), and cr_style_set_props_to_initial_values(). |
|
Serializes the rgb into a zero terminated string.
Definition at line 237 of file cr-rgb.c. Referenced by cr_rgb_dump(), cr_style_rgb_prop_val_to_string(), cr_term_one_to_string(), and cr_term_to_string(). |