In Files

Parent

Imlib2::Color::HsvaColor

Public Class Methods

new(*args) click to toggle source

Returns a new Imlib2::Color::HsvaColor.

Examples:

h, s, v, a = 255, 0, 0, 255
border = Imlib2::Color::HsvaColor.new h, s, v, a

values = [255, 0, 0, 255]
border = Imlib2::Color::HsvaColor.new values
VALUE hsva_color_new(int argc, VALUE *argv, VALUE klass) {
  HsvaColor *color;
  VALUE c_o;
  
  color = malloc(sizeof(HsvaColor));
  memset(color, 0, sizeof(HsvaColor));

  c_o = Data_Wrap_Struct(klass, 0, free, color);
  rb_obj_call_init(c_o, argc, argv);

  return c_o;
}

Public Instance Methods

a() click to toggle source

Get the alpha element of a HsvaColor object.

Examples:

amount = color.alpha
amount = color.a
static VALUE hsva_color_alpha(VALUE self) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  return INT2FIX(b->alpha);
}
a=(p1) click to toggle source

Set the alpha element of a HsvaColor object.

Examples:

color.alpha = 255
color.a = 255
static VALUE hsva_color_set_alpha(VALUE self, VALUE val) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  b->alpha = NUM2INT(val);
  return val;
}
alpha() click to toggle source

Get the alpha element of a HsvaColor object.

Examples:

amount = color.alpha
amount = color.a
static VALUE hsva_color_alpha(VALUE self) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  return INT2FIX(b->alpha);
}
alpha=(p1) click to toggle source

Set the alpha element of a HsvaColor object.

Examples:

color.alpha = 255
color.a = 255
static VALUE hsva_color_set_alpha(VALUE self, VALUE val) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  b->alpha = NUM2INT(val);
  return val;
}
h() click to toggle source

Get the hue element of a HsvaColor object.

Examples:

amount = color.hue
amount = color.h
static VALUE hsva_color_hue(VALUE self) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  return rb_float_new(b->hue);
}
h=(p1) click to toggle source

Set the hue element of a HsvaColor object.

Examples:

color.hue = 255
color.h = 255
static VALUE hsva_color_set_hue(VALUE self, VALUE val) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  b->hue = NUM2DBL(val);
  return val;
}
hue() click to toggle source

Get the hue element of a HsvaColor object.

Examples:

amount = color.hue
amount = color.h
static VALUE hsva_color_hue(VALUE self) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  return rb_float_new(b->hue);
}
hue=(p1) click to toggle source

Set the hue element of a HsvaColor object.

Examples:

color.hue = 255
color.h = 255
static VALUE hsva_color_set_hue(VALUE self, VALUE val) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  b->hue = NUM2DBL(val);
  return val;
}
s() click to toggle source

Get the saturation element of a HsvaColor object.

Examples:

amount = color.saturation
amount = color.s
static VALUE hsva_color_saturation(VALUE self) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  return rb_float_new(b->saturation);
}
s=(p1) click to toggle source

Set the saturation element of a HsvaColor object.

Examples:

color.saturation = 255
color.s = 255
static VALUE hsva_color_set_saturation(VALUE self, VALUE val) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  b->saturation = NUM2DBL(val);
  return val;
}
saturation() click to toggle source

Get the saturation element of a HsvaColor object.

Examples:

amount = color.saturation
amount = color.s
static VALUE hsva_color_saturation(VALUE self) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  return rb_float_new(b->saturation);
}
saturation=(p1) click to toggle source

Set the saturation element of a HsvaColor object.

Examples:

color.saturation = 255
color.s = 255
static VALUE hsva_color_set_saturation(VALUE self, VALUE val) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  b->saturation = NUM2DBL(val);
  return val;
}
v() click to toggle source

Get the value element of a HsvaColor object.

Examples:

amount = color.value
amount = color.v
static VALUE hsva_color_value(VALUE self) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  return rb_float_new(b->value);
}
v=(p1) click to toggle source

Set the value element of a HsvaColor object.

Examples:

color.value = 255
color.v = 255
static VALUE hsva_color_set_value(VALUE self, VALUE val) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  b->value = NUM2DBL(val);
  return val;
}
value() click to toggle source

Get the value element of a HsvaColor object.

Examples:

amount = color.value
amount = color.v
static VALUE hsva_color_value(VALUE self) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  return rb_float_new(b->value);
}
value=(p1) click to toggle source

Set the value element of a HsvaColor object.

Examples:

color.value = 255
color.v = 255
static VALUE hsva_color_set_value(VALUE self, VALUE val) {
  HsvaColor *b;
  Data_Get_Struct(self, HsvaColor, b);
  b->value = NUM2DBL(val);
  return val;
}

[Validate]

Generated with the Darkfish Rdoc Generator 2.