class HexaPDF::ImageLoader::PNG

def color_space

underlying the palette.
In the case of an indexed PNG image, this returns the definition for the color space

file.
Returns the PDF color space definition that should be used with the PDF image of the PNG
def color_space
  if @color_type == GREYSCALE || @color_type == GREYSCALE_ALPHA
    if @gamma
      [:CalGray, {WhitePoint: [1.0, 1.0, 1.0], Gamma: @gamma}]
    else
      :DeviceGray
    end
  elsif @gamma || @chrm
    dict = @chrm ? calrgb_definition_from_chrm(*@chrm) : {}
    if @gamma
      dict[:Gamma] = [@gamma, @gamma, @gamma]
      dict[:WhitePoint] ||= [1.0, 1.0, 1.0]
    end
    [:CalRGB, dict]
  else
    :DeviceRGB
  end
end