Class: RedBird::Color
- Inherits:
-
Data
- Object
- Data
- RedBird::Color
- Defined in:
- ext/red_bird/color.c,
ext/red_bird/color.c
Overview
A color represented by red, green, blue, and alpha (transparency) values.
Instance Method Summary collapse
-
#initialize(red, green, blue, alpha) ⇒ Object
constructor
Create a new color based in the RGBA color model.
Constructor Details
#initialize(red, green, blue, alpha) ⇒ Object
Create a new color based in the RGBA color model.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'ext/red_bird/color.c', line 58
VALUE
bird_cColor_initialize(VALUE self, VALUE red, VALUE green, VALUE blue,
VALUE alpha)
{
struct bird_color_data *ptr;
RB_INTEGER_TYPE_P(red);
RB_INTEGER_TYPE_P(green);
RB_INTEGER_TYPE_P(blue);
RB_INTEGER_TYPE_P(alpha);
TypedData_Get_Struct(self, struct bird_color_data, &bird_color_type, ptr);
ptr->data.r = NUM2UINT(red);
ptr->data.g = NUM2UINT(green);
ptr->data.b = NUM2UINT(blue);
ptr->data.a = NUM2UINT(alpha);
return self;
}
|