Object
Returns a new Imlib2::Color::CmyaColor.
Examples:
c, m, y, a = 255, 0, 0, 255 border = Imlib2::Color::CmyaColor.new c, m, y, a values = [255, 0, 0, 255] border = Imlib2::Color::CmyaColor.new values
VALUE cmya_color_new(int argc, VALUE *argv, VALUE klass) {
CmyaColor *color;
VALUE c_o;
color = malloc(sizeof(CmyaColor));
memset(color, 0, sizeof(CmyaColor));
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 CmyaColor object.
Examples:
amount = color.alpha amount = color.a
static VALUE cmya_color_alpha(VALUE self) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
return INT2FIX(b->alpha);
}
Set the alpha element of a CmyaColor object.
Examples:
color.alpha = 255 color.a = 255
static VALUE cmya_color_set_alpha(VALUE self, VALUE val) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
b->alpha = NUM2INT(val);
return val;
}
Get the alpha element of a CmyaColor object.
Examples:
amount = color.alpha amount = color.a
static VALUE cmya_color_alpha(VALUE self) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
return INT2FIX(b->alpha);
}
Set the alpha element of a CmyaColor object.
Examples:
color.alpha = 255 color.a = 255
static VALUE cmya_color_set_alpha(VALUE self, VALUE val) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
b->alpha = NUM2INT(val);
return val;
}
Get the cyan element of a CmyaColor object.
Examples:
amount = color.cyan amount = color.c
static VALUE cmya_color_cyan(VALUE self) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
return INT2FIX(b->cyan);
}
Set the cyan element of a CmyaColor object.
Examples:
color.cyan = 255 color.c = 255
static VALUE cmya_color_set_cyan(VALUE self, VALUE val) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
b->cyan = NUM2INT(val);
return val;
}
Get the cyan element of a CmyaColor object.
Examples:
amount = color.cyan amount = color.c
static VALUE cmya_color_cyan(VALUE self) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
return INT2FIX(b->cyan);
}
Set the cyan element of a CmyaColor object.
Examples:
color.cyan = 255 color.c = 255
static VALUE cmya_color_set_cyan(VALUE self, VALUE val) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
b->cyan = NUM2INT(val);
return val;
}
Get the magenta element of a CmyaColor object.
Examples:
amount = color.magenta amount = color.m
static VALUE cmya_color_magenta(VALUE self) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
return INT2FIX(b->magenta);
}
Set the magenta element of a CmyaColor object.
Examples:
color.magenta = 255 color.m = 255
static VALUE cmya_color_set_magenta(VALUE self, VALUE val) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
b->magenta = NUM2INT(val);
return val;
}
Get the magenta element of a CmyaColor object.
Examples:
amount = color.magenta amount = color.m
static VALUE cmya_color_magenta(VALUE self) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
return INT2FIX(b->magenta);
}
Set the magenta element of a CmyaColor object.
Examples:
color.magenta = 255 color.m = 255
static VALUE cmya_color_set_magenta(VALUE self, VALUE val) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
b->magenta = NUM2INT(val);
return val;
}
Get the yellow element of a CmyaColor object.
Examples:
amount = color.yellow amount = color.y
static VALUE cmya_color_yellow(VALUE self) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
return INT2FIX(b->yellow);
}
Set the yellow element of a CmyaColor object.
Examples:
color.yellow = 255 color.y = 255
static VALUE cmya_color_set_yellow(VALUE self, VALUE val) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
b->yellow = NUM2INT(val);
return val;
}
Get the yellow element of a CmyaColor object.
Examples:
amount = color.yellow amount = color.y
static VALUE cmya_color_yellow(VALUE self) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
return INT2FIX(b->yellow);
}
Set the yellow element of a CmyaColor object.
Examples:
color.yellow = 255 color.y = 255
static VALUE cmya_color_set_yellow(VALUE self, VALUE val) {
CmyaColor *b;
Data_Get_Struct(self, CmyaColor, b);
b->yellow = NUM2INT(val);
return val;
}
Generated with the Darkfish Rdoc Generator 2.