Object
Returns a new Imlib2::Color::HlsaColor.
Examples:
h, l, s, a = 255, 0, 0, 255 border = Imlib2::Color::HlsaColor.new h, l, s, a values = [255, 0, 0, 255] border = Imlib2::Color::HlsaColor.new values
VALUE hlsa_color_new(int argc, VALUE *argv, VALUE klass) {
HlsaColor *color;
VALUE c_o;
color = malloc(sizeof(HlsaColor));
memset(color, 0, sizeof(HlsaColor));
c_o = Data_Wrap_Struct(klass, 0, free, color);
rb_obj_call_init(c_o, argc, argv);
return c_o;
}
Get the alpha element of a HlsaColor object.
Examples:
amount = color.alpha amount = color.a
static VALUE hlsa_color_alpha(VALUE self) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
return INT2FIX(b->alpha);
}
Set the alpha element of a HlsaColor object.
Examples:
color.alpha = 255 color.a = 255
static VALUE hlsa_color_set_alpha(VALUE self, VALUE val) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
b->alpha = NUM2INT(val);
return val;
}
Get the alpha element of a HlsaColor object.
Examples:
amount = color.alpha amount = color.a
static VALUE hlsa_color_alpha(VALUE self) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
return INT2FIX(b->alpha);
}
Set the alpha element of a HlsaColor object.
Examples:
color.alpha = 255 color.a = 255
static VALUE hlsa_color_set_alpha(VALUE self, VALUE val) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
b->alpha = NUM2INT(val);
return val;
}
Get the hue element of a HlsaColor object.
Examples:
amount = color.hue amount = color.h
static VALUE hlsa_color_hue(VALUE self) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
return rb_float_new(b->hue);
}
Set the hue element of a HlsaColor object.
Examples:
color.hue = 255 color.h = 255
static VALUE hlsa_color_set_hue(VALUE self, VALUE val) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
b->hue = NUM2DBL(val);
return val;
}
Get the hue element of a HlsaColor object.
Examples:
amount = color.hue amount = color.h
static VALUE hlsa_color_hue(VALUE self) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
return rb_float_new(b->hue);
}
Set the hue element of a HlsaColor object.
Examples:
color.hue = 255 color.h = 255
static VALUE hlsa_color_set_hue(VALUE self, VALUE val) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
b->hue = NUM2DBL(val);
return val;
}
Get the lightness element of a HlsaColor object.
Examples:
amount = color.lightness amount = color.l
static VALUE hlsa_color_lightness(VALUE self) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
return rb_float_new(b->lightness);
}
Set the lightness element of a HlsaColor object.
Examples:
color.lightness = 255 color.l = 255
static VALUE hlsa_color_set_lightness(VALUE self, VALUE val) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
b->lightness = NUM2DBL(val);
return val;
}
Get the lightness element of a HlsaColor object.
Examples:
amount = color.lightness amount = color.l
static VALUE hlsa_color_lightness(VALUE self) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
return rb_float_new(b->lightness);
}
Set the lightness element of a HlsaColor object.
Examples:
color.lightness = 255 color.l = 255
static VALUE hlsa_color_set_lightness(VALUE self, VALUE val) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
b->lightness = NUM2DBL(val);
return val;
}
Get the saturation element of a HlsaColor object.
Examples:
amount = color.saturation amount = color.s
static VALUE hlsa_color_saturation(VALUE self) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
return rb_float_new(b->saturation);
}
Set the saturation element of a HlsaColor object.
Examples:
color.saturation = 255 color.h = 255
static VALUE hlsa_color_set_saturation(VALUE self, VALUE val) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
b->saturation = NUM2DBL(val);
return val;
}
Get the saturation element of a HlsaColor object.
Examples:
amount = color.saturation amount = color.s
static VALUE hlsa_color_saturation(VALUE self) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
return rb_float_new(b->saturation);
}
Set the saturation element of a HlsaColor object.
Examples:
color.saturation = 255 color.h = 255
static VALUE hlsa_color_set_saturation(VALUE self, VALUE val) {
HlsaColor *b;
Data_Get_Struct(self, HlsaColor, b);
b->saturation = NUM2DBL(val);
return val;
}
Generated with the Darkfish Rdoc Generator 2.