lib/chunky_png/palette.rb in chunky_png-0.0.3 vs lib/chunky_png/palette.rb in chunky_png-0.0.4
- old
+ new
@@ -56,10 +56,10 @@
# Builds a palette instance from a given pixel matrix.
# @param [ChunkyPNG::PixelMatrix] pixel_matrix The pixel matrix to create a palette for.
# @return [ChunkyPNG::Palette] The palette instance.
def self.from_pixel_matrix(pixel_matrix)
- self.new(pixel_matrix.pixels)
+ self.new(pixel_matrix.pixels.map { |fn| ChunkyPNG::Pixel.new(fn) })
end
# Builds a palette instance from a given set of pixels.
# @param [Enumerable<ChunkyPNG::Pixel>] pixels An enumeration of pixels to create a palette for
# @return [ChunkyPNG::Palette] The palette instance.