Object
Returns a new Imlib2::Color::RgbaColor.
Examples:
r, g, b, a = 255, 0, 0, 255 border = Imlib2::Color::RgbaColor.new r, g, b, a values = [255, 0, 0, 255] border = Imlib2::Color::RgbaColor.new values
VALUE rgba_color_new(int argc, VALUE *argv, VALUE klass) {
Imlib_Color *color;
VALUE c_o;
color = malloc(sizeof(Imlib_Color));
memset(color, 0, sizeof(Imlib_Color));
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 RgbaColor object.
Examples:
amount = color.alpha amount = color.a
static VALUE rgba_color_alpha(VALUE self) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
return INT2FIX(b->alpha);
}
Set the alpha element of a RgbaColor object.
Examples:
color.alpha = 255 color.a = 255
static VALUE rgba_color_set_alpha(VALUE self, VALUE val) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
b->alpha = NUM2INT(val);
return val;
}
Get the alpha element of a RgbaColor object.
Examples:
amount = color.alpha amount = color.a
static VALUE rgba_color_alpha(VALUE self) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
return INT2FIX(b->alpha);
}
Set the alpha element of a RgbaColor object.
Examples:
color.alpha = 255 color.a = 255
static VALUE rgba_color_set_alpha(VALUE self, VALUE val) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
b->alpha = NUM2INT(val);
return val;
}
Get the blue element of a RgbaColor object.
Examples:
amount = color.blue amount = color.b
static VALUE rgba_color_blue(VALUE self) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
return INT2FIX(b->blue);
}
Set the blue element of a RgbaColor object.
Examples:
color.blue = 255 color.b = 255
static VALUE rgba_color_set_blue(VALUE self, VALUE val) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
b->blue = NUM2INT(val);
return val;
}
Get the blue element of a RgbaColor object.
Examples:
amount = color.blue amount = color.b
static VALUE rgba_color_blue(VALUE self) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
return INT2FIX(b->blue);
}
Set the blue element of a RgbaColor object.
Examples:
color.blue = 255 color.b = 255
static VALUE rgba_color_set_blue(VALUE self, VALUE val) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
b->blue = NUM2INT(val);
return val;
}
Get the green element of a RgbaColor object.
Examples:
amount = color.green amount = color.g
static VALUE rgba_color_green(VALUE self) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
return INT2FIX(b->green);
}
Set the green element of a RgbaColor object.
Examples:
color.green = 255 color.g = 255
static VALUE rgba_color_set_green(VALUE self, VALUE val) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
b->green = NUM2INT(val);
return val;
}
Get the green element of a RgbaColor object.
Examples:
amount = color.green amount = color.g
static VALUE rgba_color_green(VALUE self) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
return INT2FIX(b->green);
}
Set the green element of a RgbaColor object.
Examples:
color.green = 255 color.g = 255
static VALUE rgba_color_set_green(VALUE self, VALUE val) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
b->green = NUM2INT(val);
return val;
}
Get the red element of a RgbaColor object.
Examples:
amount = color.red amount = color.r
static VALUE rgba_color_red(VALUE self) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
return INT2FIX(b->red);
}
Set the red element of a RgbaColor object.
Examples:
color.red = 255 color.r = 255
static VALUE rgba_color_set_red(VALUE self, VALUE val) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
b->red = NUM2INT(val);
return val;
}
Get the red element of a RgbaColor object.
Examples:
amount = color.red amount = color.r
static VALUE rgba_color_red(VALUE self) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
return INT2FIX(b->red);
}
Set the red element of a RgbaColor object.
Examples:
color.red = 255 color.r = 255
static VALUE rgba_color_set_red(VALUE self, VALUE val) {
Imlib_Color *b;
Data_Get_Struct(self, Imlib_Color, b);
b->red = NUM2INT(val);
return val;
}
Generated with the Darkfish Rdoc Generator 2.