Top |
Functions
CRRgb * | cr_rgb_new () |
CRRgb * | cr_rgb_new_with_vals () |
CRRgb * | cr_rgb_parse_from_buf () |
enum CRStatus | cr_rgb_compute_from_percentage () |
enum CRStatus | cr_rgb_set () |
enum CRStatus | cr_rgb_copy () |
enum CRStatus | cr_rgb_set_to_inherit () |
gboolean | cr_rgb_is_set_to_inherit () |
gboolean | cr_rgb_is_set_to_transparent () |
enum CRStatus | cr_rgb_set_to_transparent () |
enum CRStatus | cr_rgb_set_from_rgb () |
enum CRStatus | cr_rgb_set_from_name () |
enum CRStatus | cr_rgb_set_from_hex_str () |
enum CRStatus | cr_rgb_set_from_term () |
guchar * | cr_rgb_to_string () |
void | cr_rgb_dump () |
void | cr_rgb_destroy () |
Functions
cr_rgb_new ()
CRRgb *
cr_rgb_new (void
);
The default constructor of CRRgb.
Returns the newly built instance of CRRgb
cr_rgb_new_with_vals ()
CRRgb * cr_rgb_new_with_vals (gulong a_red
,gulong a_green
,gulong a_blue
,gboolean a_is_percentage
);
A constructor of CRRgb.
Returns the newly built instance of CRRgb.
cr_rgb_parse_from_buf ()
CRRgb * cr_rgb_parse_from_buf (const guchar *a_str
,enum CREncoding a_enc
);
Parses a text buffer that contains a rgb color
Returns the parsed color, or NULL in case of error
cr_rgb_compute_from_percentage ()
enum CRStatus
cr_rgb_compute_from_percentage (CRRgb *a_this
);
If the rgb values are expressed in percentage, compute their real value.
Returns CR_OK upon successful completion, an error code otherwise.
cr_rgb_set ()
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.
Returns CR_OK upon successful completion, an error code otherwise.
Parameters
a_this |
the current instance of CRRgb. |
|
a_red |
the red value. |
|
a_green |
the green value. |
|
a_blue |
the blue value. |
cr_rgb_set_to_inherit ()
enum CRStatus cr_rgb_set_to_inherit (CRRgb *a_this
,gboolean a_inherit
);
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".
Returns CR_OK upon succesful completion, an error code otherwise.
cr_rgb_is_set_to_inherit ()
gboolean
cr_rgb_is_set_to_inherit (CRRgb const *a_this
);
a_this
: the current instance of CRRgb.
Returns TRUE if the rgb is set to the value "inherit", FALSE otherwise.
cr_rgb_is_set_to_transparent ()
gboolean
cr_rgb_is_set_to_transparent (CRRgb const *a_this
);
Tests if the the rgb is set to the value "transparent" or not.
Returns TRUE if the rgb has been set to transparent, FALSE otherwise.
cr_rgb_set_to_transparent ()
enum CRStatus cr_rgb_set_to_transparent (CRRgb *a_this
,gboolean a_is_transparent
);
Sets the rgb to the "transparent" value (or not) Returns CR_OK upon successfull completion, an error code otherwise.
cr_rgb_set_from_rgb ()
enum CRStatus cr_rgb_set_from_rgb (CRRgb *a_this
,CRRgb const *a_rgb
);
Sets the rgb from an other one.
Returns CR_OK upon successful completion, an error code otherwise.
cr_rgb_set_from_name ()
enum CRStatus cr_rgb_set_from_name (CRRgb *a_this
,const guchar *a_color_name
);
Returns CR_OK upon successful completion, an error code otherwise.
cr_rgb_set_from_hex_str ()
enum CRStatus cr_rgb_set_from_hex_str (CRRgb *a_this
,const guchar *a_hex_value
);
Returns CR_OK upon successful completion.
cr_rgb_set_from_term ()
enum CRStatus cr_rgb_set_from_term (CRRgb *a_this
,const struct _CRTerm *a_value
);
Set the rgb from a terminal symbol
Returns CR_OK upon successful completion, an error code otherwise.
cr_rgb_to_string ()
guchar *
cr_rgb_to_string (CRRgb const *a_this
);
Serializes the rgb into a zero terminated string.
Returns the zero terminated string containing the serialized
rgb. MUST BE FREED by the caller using g_free()
.
cr_rgb_dump ()
void cr_rgb_dump (CRRgb const *a_this
,FILE *a_fp
);
Dumps the current instance of CRRgb to a file.
Parameters
a_this |
the "this pointer" of the current instance of CRRgb. |
|
a_fp |
the destination file pointer. |