In Files

Parent

Imlib2::Color::RgbaColor

Public Class Methods

new(*args) click to toggle source

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;
}

Public Instance Methods

a() click to toggle source

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);
}
a=(p1) click to toggle source

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;
}
alpha() click to toggle source

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);
}
alpha=(p1) click to toggle source

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;
}
b() click to toggle source

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);
}
b=(p1) click to toggle source

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;
}
blue() click to toggle source

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);
}
blue=(p1) click to toggle source

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;
}
g() click to toggle source

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);
}
g=(p1) click to toggle source

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;
}
green() click to toggle source

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);
}
green=(p1) click to toggle source

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;
}
r() click to toggle source

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);
}
r=(p1) click to toggle source

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;
}
red() click to toggle source

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);
}
red=(p1) click to toggle source

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;
}

[Validate]

Generated with the Darkfish Rdoc Generator 2.