Class: GD2::Palette::TrueColor

Inherits:
GD2::Palette show all
Defined in:
lib/gd2/palette.rb

Instance Attribute Summary

Attributes inherited from GD2::Palette

#image

Instance Method Summary collapse

Methods inherited from GD2::Palette

#<<, #[], #allocate, #available, #closest, #closest_hwb, #deallocate, #deallocate_unused, #exact, #exact!, #initialize, #resolve

Constructor Details

This class inherits a constructor from GD2::Palette

Instance Method Details

#[]=(index, color) ⇒ Object

:nodoc:



231
232
233
# File 'lib/gd2/palette.rb', line 231

def []=(index, color)   #:nodoc:
  raise "Palette assignment not supported for #{self.class}"
end

#include?(color) ⇒ Boolean

Return true.

Returns:

  • (Boolean)


222
223
224
# File 'lib/gd2/palette.rb', line 222

def include?(color)
  true
end

#inspectObject

:nodoc:



206
207
208
# File 'lib/gd2/palette.rb', line 206

def inspect   #:nodoc:
  "#<#{self.class}>"
end

#sizeObject Also known as: length, used

:nodoc:



210
211
212
# File 'lib/gd2/palette.rb', line 210

def size  #:nodoc:
  ((1 + RGB_MAX) ** 3) * (1 + ALPHA_MAX)
end