Class: Imlib2::Color::RgbaColor

### Home Classes Methods

### In Files

- imlib2.c

### Parent

Object

### Methods

- ::new
- #a
- #a=
- #alpha
- #alpha=
- #b
- #b=
- #blue
- #blue=
- #g
- #g=
- #green
- #green=
- #r
- #r=
- #red
- #red=

### Files

- AUTHORS
- COPYING
- ChangeLog
- README
- TODO

### Class/Module Index

Quicksearch

- Imlib2
- Imlib2::Border
- Imlib2::Cache
- Imlib2::Color
- Imlib2::Color::CmyaColor
- Imlib2::Color::HlsaColor
- Imlib2::Color::HsvaColor
- Imlib2::Color::RgbaColor
- Imlib2::ColorModifier
- Imlib2::Context
- Imlib2::Dir
- Imlib2::Direction
- Imlib2::Encoding
- Imlib2::Error
- Imlib2::Error::DeletedError
- Imlib2::FileError
- Imlib2::Filter
- Imlib2::Font
- Imlib2::Gradient
- Imlib2::Image
- Imlib2::Op
- Imlib2::Operation
- Imlib2::Polygon

No matching classes.

# 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.