Skip to content

color_component_t

概述

image
image

颜色选择器的颜色分量。 控件的名称有严格规定: COLOR_PICKER_CHILD_SV: 水平为Value/Brightness(递增),垂直为Saturation(递减)。 COLOR_PICKER_CHILD_H: 水平为同色,垂直为Hue(递减)。

函数

函数名称说明
color_component_cast转换为color_component对象(供脚本语言使用)。
color_component_create创建color_component对象
color_component_get_h获取h分量。
color_component_get_s获取s分量。
color_component_get_v获取v分量。
color_component_get_widget_vtable获取 color_component 虚表。
color_component_set_color设置颜色。
color_component_set_hsv设置颜色。

事件

事件名称类型说明
EVT_VALUE_CHANGINGvalue_change_event_t颜色正在改变事件。

color_component_cast 函数

  • 函数功能:

转换为color_component对象(供脚本语言使用)。

  • 函数原型:
widget_t* color_component_cast (widget_t* widget);
  • 参数说明:
参数类型说明
返回值widget_t*color_component对象。
widgetwidget_t*color_component对象。

color_component_create 函数

  • 函数功能:

创建color_component对象

  • 函数原型:
widget_t* color_component_create (widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
  • 参数说明:
参数类型说明
返回值widget_t*对象。
parentwidget_t*父控件
xxy_tx坐标
yxy_ty坐标
wwh_t宽度
hwh_t高度

color_component_get_h 函数

  • 函数功能:

获取h分量。

  • 函数原型:
float color_component_get_h (widget_t* widget);
  • 参数说明:
参数类型说明
返回值float返回h分量。
widgetwidget_t*color_component对象。

color_component_get_s 函数

  • 函数功能:

获取s分量。

  • 函数原型:
float color_component_get_s (widget_t* widget);
  • 参数说明:
参数类型说明
返回值float返回s分量。
widgetwidget_t*color_component对象。

color_component_get_v 函数

  • 函数功能:

获取v分量。

  • 函数原型:
float color_component_get_v (widget_t* widget);
  • 参数说明:
参数类型说明
返回值float返回v分量。
widgetwidget_t*color_component对象。

color_component_get_widget_vtable 函数

  • 函数功能:

获取 color_component 虚表。

  • 函数原型:
const widget_vtable_t* color_component_get_widget_vtable ();
  • 参数说明:
参数类型说明
返回值const widget_vtable_t*成功返回 color_component 虚表。

color_component_set_color 函数

  • 函数功能:

设置颜色。

  • 函数原型:
ret_t color_component_set_color (widget_t* widget, color_t c);
  • 参数说明:
参数类型说明
返回值ret_t返回RET_OK表示成功,否则表示失败。
widgetwidget_t*控件对象。
ccolor_t颜色。

color_component_set_hsv 函数

  • 函数功能:

设置颜色。

  • 函数原型:
ret_t color_component_set_hsv (widget_t* widget, float h, float s, float v);
  • 参数说明:
参数类型说明
返回值ret_t返回RET_OK表示成功,否则表示失败。
widgetwidget_t*控件对象。
hfloat色调。
sfloat饱和度。
vfloat明度。