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:



249
250
251
# File 'lib/gd2/palette.rb', line 249

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

#include?(color) ⇒ Boolean

Return true.

Returns:

  • (Boolean)


240
241
242
# File 'lib/gd2/palette.rb', line 240

def include?(color)
  true
end

#inspectObject

:nodoc:



224
225
226
# File 'lib/gd2/palette.rb', line 224

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

#sizeObject Also known as: length, used

:nodoc:



228
229
230
# File 'lib/gd2/palette.rb', line 228

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