Returns the color at the given index in the palette, as an SDL::Color instance.
# File lib/ruby-sdl-ffi/sdl/video.rb, line 68 def at( index ) index = (0...ncolors).to_a.at(index) if index SDL::Color.new( self[:colors] + index * SDL::Color.size ) end end
Yields an SDL::Color for each color in the palette.
# File lib/ruby-sdl-ffi/sdl/video.rb, line 76 def each ncolors.times{ |i| yield at(i) } end
Generated with the Darkfish Rdoc Generator 2.