In Files

Parent

Imlib2::Color::HlsaColor

Public Class Methods

new(*args) click to toggle source

Returns a new Imlib2::Color::HlsaColor.

Examples:

h, l, s, a = 255, 0, 0, 255
border = Imlib2::Color::HlsaColor.new h, l, s, a

values = [255, 0, 0, 255]
border = Imlib2::Color::HlsaColor.new values
VALUE hlsa_color_new(int argc, VALUE *argv, VALUE klass) {
  HlsaColor *color;
  VALUE c_o;
  
  color = malloc(sizeof(HlsaColor));
  memset(color, 0, sizeof(HlsaColor));

  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 HlsaColor object.

Examples:

amount = color.alpha
amount = color.a
static VALUE hlsa_color_alpha(VALUE self) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  return INT2FIX(b->alpha);
}
a=(p1) click to toggle source

Set the alpha element of a HlsaColor object.

Examples:

color.alpha = 255
color.a = 255
static VALUE hlsa_color_set_alpha(VALUE self, VALUE val) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  b->alpha = NUM2INT(val);
  return val;
}
alpha() click to toggle source

Get the alpha element of a HlsaColor object.

Examples:

amount = color.alpha
amount = color.a
static VALUE hlsa_color_alpha(VALUE self) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  return INT2FIX(b->alpha);
}
alpha=(p1) click to toggle source

Set the alpha element of a HlsaColor object.

Examples:

color.alpha = 255
color.a = 255
static VALUE hlsa_color_set_alpha(VALUE self, VALUE val) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  b->alpha = NUM2INT(val);
  return val;
}
h() click to toggle source

Get the hue element of a HlsaColor object.

Examples:

amount = color.hue
amount = color.h
static VALUE hlsa_color_hue(VALUE self) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  return rb_float_new(b->hue);
}
h=(p1) click to toggle source

Set the hue element of a HlsaColor object.

Examples:

color.hue = 255
color.h = 255
static VALUE hlsa_color_set_hue(VALUE self, VALUE val) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  b->hue = NUM2DBL(val);
  return val;
}
hue() click to toggle source

Get the hue element of a HlsaColor object.

Examples:

amount = color.hue
amount = color.h
static VALUE hlsa_color_hue(VALUE self) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  return rb_float_new(b->hue);
}
hue=(p1) click to toggle source

Set the hue element of a HlsaColor object.

Examples:

color.hue = 255
color.h = 255
static VALUE hlsa_color_set_hue(VALUE self, VALUE val) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  b->hue = NUM2DBL(val);
  return val;
}
l() click to toggle source

Get the lightness element of a HlsaColor object.

Examples:

amount = color.lightness
amount = color.l
static VALUE hlsa_color_lightness(VALUE self) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  return rb_float_new(b->lightness);
}
l=(p1) click to toggle source

Set the lightness element of a HlsaColor object.

Examples:

color.lightness = 255
color.l = 255
static VALUE hlsa_color_set_lightness(VALUE self, VALUE val) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  b->lightness = NUM2DBL(val);
  return val;
}
lightness() click to toggle source

Get the lightness element of a HlsaColor object.

Examples:

amount = color.lightness
amount = color.l
static VALUE hlsa_color_lightness(VALUE self) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  return rb_float_new(b->lightness);
}
lightness=(p1) click to toggle source

Set the lightness element of a HlsaColor object.

Examples:

color.lightness = 255
color.l = 255
static VALUE hlsa_color_set_lightness(VALUE self, VALUE val) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  b->lightness = NUM2DBL(val);
  return val;
}
s() click to toggle source

Get the saturation element of a HlsaColor object.

Examples:

amount = color.saturation
amount = color.s
static VALUE hlsa_color_saturation(VALUE self) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  return rb_float_new(b->saturation);
}
s=(p1) click to toggle source

Set the saturation element of a HlsaColor object.

Examples:

color.saturation = 255
color.h = 255
static VALUE hlsa_color_set_saturation(VALUE self, VALUE val) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  b->saturation = NUM2DBL(val);
  return val;
}
saturation() click to toggle source

Get the saturation element of a HlsaColor object.

Examples:

amount = color.saturation
amount = color.s
static VALUE hlsa_color_saturation(VALUE self) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  return rb_float_new(b->saturation);
}
saturation=(p1) click to toggle source

Set the saturation element of a HlsaColor object.

Examples:

color.saturation = 255
color.h = 255
static VALUE hlsa_color_set_saturation(VALUE self, VALUE val) {
  HlsaColor *b;
  Data_Get_Struct(self, HlsaColor, b);
  b->saturation = NUM2DBL(val);
  return val;
}

[Validate]

Generated with the Darkfish Rdoc Generator 2.