Class: Imlib2::Color::HlsaColor

### Home Classes Methods

### In Files

- imlib2.c

### Parent

Object

### Methods

- ::new
- #a
- #a=
- #alpha
- #alpha=
- #h
- #h=
- #hue
- #hue=
- #l
- #l=
- #lightness
- #lightness=
- #s
- #s=
- #saturation
- #saturation=

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