class Cairo::Color::Base - cairo-1.16.4 Documentation

# class Cairo::Color::Base

### Attributes

a[RW]
a=[RW]
alpha[RW]

### Public Class Methods

new(a) click to toggle source

    # File lib/cairo/color.rb, line 57
    def initialize(a)
      assert_in_range(a, "alpha channel")
      @alpha = a
    end

### Private Instance Methods

assert_in_range(value, description) click to toggle source

    # File lib/cairo/color.rb, line 63
    def assert_in_range(value, description)
      unless (0.0..1.0).include?(value)
        raise ArgumentError,
              "#{description} value should be in [0.0, 1.0]: #{value.inspect}"
      end
    end