forked from enlightenment/efl
Efl.Gfx.Color: add color_class_code.set/get{} method
This commit is contained in:
parent
c3e322be28
commit
44b6aa16c1
|
@ -117,4 +117,27 @@ _efl_gfx_color_color_code_get(Eo *obj, void *_pd EINA_UNUSED)
|
|||
return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a);
|
||||
}
|
||||
|
||||
#include "interfaces/efl_gfx_color.eo.c"
|
||||
EOLIAN static void
|
||||
_efl_gfx_color_color_class_code_set(Eo *obj, void *_pd EINA_UNUSED, const char *color_class,
|
||||
Efl_Gfx_Color_Class_Layer layer, const char *colorcode)
|
||||
{
|
||||
int len;
|
||||
unsigned char r, g, b, a;
|
||||
|
||||
len = _format_clean_param(colorcode);
|
||||
|
||||
_format_color_parse(colorcode, len, &r, &g, &b, &a);
|
||||
efl_gfx_color_class_set(obj, color_class, layer, r, g, b, a);
|
||||
}
|
||||
|
||||
EOLIAN static const char *
|
||||
_efl_gfx_color_color_class_code_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED,
|
||||
const char *color_class, Efl_Gfx_Color_Class_Layer layer)
|
||||
{
|
||||
int r, g, b, a;
|
||||
|
||||
efl_gfx_color_class_get(obj, color_class, layer, &r, &g, &b, &a);
|
||||
return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a);
|
||||
}
|
||||
|
||||
#include "interfaces/efl_gfx_color.eo.c"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import efl_gfx_types;
|
||||
|
||||
mixin Efl.Gfx.Color
|
||||
{
|
||||
[[Efl Gfx Color mixin class]]
|
||||
|
@ -58,5 +60,24 @@ mixin Efl.Gfx.Color
|
|||
colorcode: string; [[the hex color code.]]
|
||||
}
|
||||
}
|
||||
@property color_class_code {
|
||||
set {
|
||||
[[Set the color class color of given Evas Object to the given hex color code(#RRGGBBAA).
|
||||
e.g. efl_gfx_color_class_code_set(obj, "color_class_name", layer, "#FFCCAACC");
|
||||
]]
|
||||
}
|
||||
get {
|
||||
[[Get hex color class code of given Evas Object.
|
||||
This returns a short lived hex color class code string.
|
||||
]]
|
||||
}
|
||||
keys {
|
||||
color_class: string; [[The name of color class]]
|
||||
layer: Efl.Gfx.Color_Class.Layer @optional; [[The layer to set the color]]
|
||||
}
|
||||
values {
|
||||
colorcode: string; [[the hex color code.]]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue