提交 b18acab7 编写于 作者: B Behdad Esfahbod

[color] Add HB_COLOR

Normally I would have added to_string / from_string like other types
have.  But since we don't use hb_color_t much, I'm not going to do that.
Although, if we did, we could use it in hb-view to parse colors...
上级 228f96c9
......@@ -446,16 +446,20 @@ hb_variation_to_string (hb_variation_t *variation,
/**
* hb_color_t:
* ARGB data type for holding color values.
*
* Data type for holding color values.
*
* Since: REPLACEME
*/
typedef uint32_t hb_color_t;
#define hb_color_get_alpha(color) (color & 0xFF)
#define hb_color_get_red(color) ((color >> 8) & 0xFF)
#define hb_color_get_green(color) ((color >> 16) & 0xFF)
#define hb_color_get_blue(color) ((color >> 24) & 0xFF)
#define HB_COLOR(b,g,r,a) ((hb_color_t) HB_TAG ((b),(g),(r),(a)))
#define hb_color_get_alpha(color) ((color) & 0xFF)
#define hb_color_get_red(color) (((color) >> 8) & 0xFF)
#define hb_color_get_green(color) (((color) >> 16) & 0xFF)
#define hb_color_get_blue(color) (((color) >> 24) & 0xFF)
HB_END_DECLS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册