Parent

Methods

Included Modules

SDL::Palette

Public Instance Methods

at( index ) click to toggle source

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
each() click to toggle source

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.