# :stopdoc:
# This file is automatically generated by the WXRuby3 documentation
# generator. Do not alter this file.
# :startdoc:
module Wx
# An empty palette.
#
NULL_PALETTE = nil
# A palette is a table that maps pixel values to RGB colours.
# It allows the colours of a low-depth bitmap, for example, to be mapped to the available colours in a display. The notion of palettes is becoming more and more obsolete nowadays and only the MSW port is still using a native palette. All other ports use generic code which is basically just an array of colours.
# It is likely that in the future the only use for palettes within wxWidgets will be for representing colour indices from images (such as GIF or PNG). The image handlers for these formats have been modified to create a palette if there is such information in the original image file (usually 256 or less colour images). See {Wx::Image} for more information.
# ===
#
# Category: Graphics Device Interface (GDI)
# Predefined objects/pointers: {Wx::NULL_PALETTE}
# @see Wx::DC#set_palette
# @see Wx::Bitmap
#
#
#
# @note This class is untracked and should not be derived from nor instances extended!
class Palette < GDIObject
# @overload initialize()
# Default constructor.
# @return [Wx::Palette]
# @overload initialize(palette)
# Copy constructor, uses Reference Counting.
# @param palette [Wx::Palette] A reference to the palette to copy.
# @return [Wx::Palette]
# @overload initialize(n, green, blue)
# Creates a palette from arrays of size n, one for each red, blue or green component.
#
# @see Wx::Palette#create
# @param n [Array] The number of indices in the palette.
# @param green [Array] An array of green values.
# @param blue [Array] An array of blue values.
# @return [Wx::Palette]
def initialize(*args) end
# Creates a palette from arrays of size n, one for each red, blue or green component.
# true if the creation was successful, false otherwise.
# @see Wx::Palette#initialize
# @param n [Array] The number of indices in the palette.
# @param green [Array] An array of green values.
# @param blue [Array] An array of blue values.
# @return [Boolean]
def create(n, green, blue) end
# Returns number of entries in palette.
# @return [Integer]
def get_colours_count; end
alias_method :colours_count, :get_colours_count
# Returns a pixel value (index into the palette) for the given RGB values.
# The nearest palette index or {Wx::NOT_FOUND} for unexpected errors.
# @see Wx::Palette#get_rgb
# @param red [Integer] Red value.
# @param green [Integer] Green value.
# @param blue [Integer] Blue value.
# @return [Integer]
def get_pixel(red, green, blue) end
alias_method :pixel, :get_pixel
# Returns RGB values for a given palette index.
# true if the operation was successful.
# @see Wx::Palette#get_pixel
# @param pixel [Integer] The palette index.
# @param red [unsigned char] Receives the red value.
# @param green [unsigned char] Receives the green value.
# @param blue [unsigned char] Receives the blue value.
# @return [Boolean]
def get_rgb(pixel, red, green, blue) end
alias_method :rgb, :get_rgb
# Returns true if palette data is present.
# @return [Boolean]
def is_ok; end
alias_method :ok?, :is_ok
end # Palette
end