Class: Imlib2::ColorModifier

### Home Classes Methods

### In Files

- imlib2.c

### Parent

Object

### Methods

- ::new
- #brightness=
- #contrast=
- #gamma=
- #reset

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

### Public Class Methods

new(*args) click to toggle source

Returns a new Imlib2::ColorModifier

Example:

    cmod = Imlib2::ColorModifier.new

    VALUE cmod_new(VALUE klass) {
      Imlib_Color_Modifier *cmod;
      VALUE self;

      cmod = malloc(sizeof(Imlib_Color_Modifier));
      self = Data_Wrap_Struct(klass, 0, cmod_free, cmod);

      rb_obj_call_init(self, 0, NULL);

      return self;
    }

### Public Instance Methods

brightness=(p1) click to toggle source

Set the brightness value.

Example:

    cmod.brightness = 2.0

    static VALUE cmod_brightness(VALUE self, VALUE brightness) {
      Imlib_Color_Modifier *cmod;

      Data_Get_Struct(self, Imlib_Color_Modifier, cmod);
      imlib_context_set_color_modifier(*cmod);
      imlib_modify_color_modifier_brightness(NUM2DBL(brightness));

      return self;
    }

contrast=(p1) click to toggle source

Set the contrast value.

Example:

    cmod.contrast = 0.8

    static VALUE cmod_contrast(VALUE self, VALUE contrast) {
      Imlib_Color_Modifier *cmod;

      Data_Get_Struct(self, Imlib_Color_Modifier, cmod);
      imlib_context_set_color_modifier(*cmod);
      imlib_modify_color_modifier_contrast(NUM2DBL(contrast));

      return self;
    }

gamma=(p1) click to toggle source

Set the gamma value.

Example:

    cmod.gamma = 0.5

    static VALUE cmod_gamma(VALUE self, VALUE gamma) {
      Imlib_Color_Modifier *cmod;

      Data_Get_Struct(self, Imlib_Color_Modifier, cmod);
      imlib_context_set_color_modifier(*cmod);
      imlib_modify_color_modifier_gamma(NUM2DBL(gamma));

      return self;
    }

reset() click to toggle source

Reset the Imlib2::ColorModifier

Example:

    cmod.reset

    static VALUE cmod_reset(VALUE self) {
      Imlib_Color_Modifier *cmod;

      Data_Get_Struct(self, Imlib_Color_Modifier, cmod);
      imlib_context_set_color_modifier(*cmod);
      imlib_reset_color_modifier();

      return self;
    }

[Validate]

Generated with the Darkfish Rdoc Generator 2.