# :stopdoc:
# This file is automatically generated by the WXRuby3 documentation
# generator. Do not alter this file.
# :startdoc:
module Wx
#
#
C2S_NAME = 1
#
#
C2S_CSS_SYNTAX = 2
#
#
C2S_HTML_SYNTAX = 4
#
#
ALPHA_TRANSPARENT = 0
#
#
ALPHA_OPAQUE = 255
#
#
NULL_COLOUR = nil
# Converts string to a {Wx::Colour} best represented by the given string.
#
# Returns true on success.
# @see wxToString(const wxColour&)
# @param string [String]
# @param colour [Wx::Colour]
# @return [Boolean]
def self.from_string(string, colour) end
# Converts the given {Wx::Colour} into a string.
#
#
# @see wxFromString(const wxString&
# @see wxColour*)
# @param colour [Wx::Colour,String,Symbol]
# @return [String]
def self.to_string(colour) end
# A colour is an object representing a combination of Red, Green, and Blue (RGB) intensity values and an Alpha value, and is used to determine drawing colours.
#
# See the entry for {Wx::ColourDatabase} for how a pointer to a predefined, named colour may be returned instead of creating a new colour.
# Valid RGB values are in the range 0 to 255.
# You can retrieve the current system colour settings with {Wx::SystemSettings}.
#
# ## Channel Accessor Functions
# Note that this class provides pairs of functions for each of the colour channels, i.e. red, green, blue and alpha values. The one word functions {Wx::Colour#red}, {Wx::Colour#green}, {Wx::Colour#blue} and {Wx::Colour#alpha} return the values of type unsigned char, while {Wx::Colour#get_red}, {Wx::Colour#get_green}, {Wx::Colour#get_blue} and {Wx::Colour#get_alpha} returns the same value as unsigned int. According to the C++ integer promotion rules, the result of any arithmetic expression involving the former will be (signed) int, while that of the latter will be unsigned, which is what would be commonly expected, so the latter family of functions should be typically preferred (but they are only available since wxWidgets 3.1.6).
#
# Category: Graphics Device Interface (GDI)
# Predefined objects/pointers:
#
# - {Wx::NULL_COLOUR} - An empty, invalid colour.
# - {Wx::TransparentColour} - Valid but fully transparent colour (new in 2.9.1).
# - {Wx::BLACK}
# - {Wx::BLUE}
# - {Wx::CYAN}
# - {Wx::GREEN}
# - {Wx::YELLOW}
# - {Wx::LIGHT_GREY}
# - {Wx::RED}
# - {Wx::WHITE}
# @see Wx::ColourDatabase
# @see Wx::Pen
# @see Wx::Brush
# @see Wx::ColourDialog
# @see Wx::SystemSettings
#
#
#
# @note This class is untracked and should not be derived from nor instances extended!
class Colour < Object
# Sets the RGB or RGBA colour values from a single 32 bit value.
#
# The arguments colRGB and colRGBA should be of the form 0x00BBGGRR and 0xAABBGGRR respectively where 0xRR, 0xGG, 0xBB and 0xAA are the values of the red, green, blue and alpha components.
# Notice the right-to-left order of components!
# @see Wx::Colour#get_rgb
# @see Wx::Colour#get_rgba
# @param colRGB [Integer]
# @return [void]
def set_rgb(colRGB) end
alias_method :rgb=, :set_rgb
# Sets the RGB or RGBA colour values from a single 32 bit value.
#
# The arguments colRGB and colRGBA should be of the form 0x00BBGGRR and 0xAABBGGRR respectively where 0xRR, 0xGG, 0xBB and 0xAA are the values of the red, green, blue and alpha components.
# Notice the right-to-left order of components!
# @see Wx::Colour#get_rgb
# @see Wx::Colour#get_rgba
# @param colRGBA [Integer]
# @return [void]
def set_rgba(colRGBA) end
alias_method :rgba=, :set_rgba
# Gets the RGB or RGBA colour values as a single 32 bit value.
#
# The returned value is of the same form as expected by {Wx::Colour#set_rgb} and {Wx::Colour#set_rgba}.
# Notice that {Wx::Colour#get_rgb} returns the value with 0 as its highest byte independently of the value actually returned by {Wx::Colour#alpha}. So for a fully opaque colour, the return value of {Wx::Colour#get_rgba} is 0xFFBBGGRR while that of {Wx::Colour#get_rgb} is 0x00BBGGRR.
# @return [Integer]
def get_rgb; end
alias_method :rgb, :get_rgb
# Gets the RGB or RGBA colour values as a single 32 bit value.
#
# The returned value is of the same form as expected by {Wx::Colour#set_rgb} and {Wx::Colour#set_rgba}.
# Notice that {Wx::Colour#get_rgb} returns the value with 0 as its highest byte independently of the value actually returned by {Wx::Colour#alpha}. So for a fully opaque colour, the return value of {Wx::Colour#get_rgba} is 0xFFBBGGRR while that of {Wx::Colour#get_rgb} is 0x00BBGGRR.
# @return [Integer]
def get_rgba; end
alias_method :rgba, :get_rgba
# @overload set(red, green, blue, alpha=Wx::ALPHA_OPAQUE)
# Sets the RGB intensity values using the given values (first overload), extracting them from the packed long (second overload), using the given string (third overload).
#
# When using third form, {Wx::Colour#set} accepts: colour names (those listed in {Wx::ColourDatabase}), the CSS-like "rgb(r,g,b)"
or "rgba(r,g,b,a)"
syntax (case insensitive) and the HTML-like syntax: "#"
followed by 6 hexadecimal digits for red, green, blue components.
# Returns true if the conversion was successful, false otherwise.
# @param red [Integer]
# @param green [Integer]
# @param blue [Integer]
# @param alpha [Integer]
# @return [void]
# @overload set(rGB)
# Sets the RGB intensity values using the given values (first overload), extracting them from the packed long (second overload), using the given string (third overload).
#
# When using third form, {Wx::Colour#set} accepts: colour names (those listed in {Wx::ColourDatabase}), the CSS-like "rgb(r,g,b)"
or "rgba(r,g,b,a)"
syntax (case insensitive) and the HTML-like syntax: "#"
followed by 6 hexadecimal digits for red, green, blue components.
# Returns true if the conversion was successful, false otherwise.
# @param rGB [Integer]
# @return [void]
# @overload set(str)
# Sets the RGB intensity values using the given values (first overload), extracting them from the packed long (second overload), using the given string (third overload).
#
# When using third form, {Wx::Colour#set} accepts: colour names (those listed in {Wx::ColourDatabase}), the CSS-like "rgb(r,g,b)"
or "rgba(r,g,b,a)"
syntax (case insensitive) and the HTML-like syntax: "#"
followed by 6 hexadecimal digits for red, green, blue components.
# Returns true if the conversion was successful, false otherwise.
# @param str [String]
# @return [Boolean]
def set(*args) end
# @overload initialize()
# Default constructor.
# @return [Wx::Colour]
# @overload initialize(red, green, blue, alpha=Wx::ALPHA_OPAQUE)
# @param red [Integer] The red value.
# @param green [Integer] The green value.
# @param blue [Integer] The blue value.
# @param alpha [Integer] The alpha value. Alpha values range from 0 ({Wx::ALPHA_TRANSPARENT}) to 255 ({Wx::ALPHA_OPAQUE}).
# @return [Wx::Colour]
# @overload initialize(colourName)
# @param colourName [String] The colour name.
# @return [Wx::Colour]
# @overload initialize(colRGB)
# @param colRGB [Integer] A packed RGB value.
# @return [Wx::Colour]
# @overload initialize(colour)
# Copy constructor.
# @param colour [Wx::Colour,String,Symbol]
# @return [Wx::Colour]
def initialize(*args) end
# Returns the alpha value, on platforms where alpha is not yet supported, this always returns {Wx::ALPHA_OPAQUE}.
#
#
# @see Wx::Colour#get_alpha
# @return [Integer]
def alpha; end
# Returns the blue intensity.
#
#
# @see Wx::Colour#get_blue
# @return [Integer]
def blue; end
# Returns the alpha value, on platforms where alpha is not yet supported, this always returns {Wx::ALPHA_OPAQUE}.
# @return [Integer]
def get_alpha; end
# Returns the blue intensity as unsigned int.
# @return [Integer]
def get_blue; end
# Returns the green intensity as unsigned int.
# @return [Integer]
def get_green; end
# Returns the red intensity as unsigned int.
# @return [Integer]
def get_red; end
# Converts this colour to a {Wx::String} using the given flags.
#
# The supported flags are {Wx::C2S_NAME}, to obtain the colour name (e.g. {colour(255,0,0)} == "red"), {Wx::C2S_CSS_SYNTAX}, to obtain the colour in the "rgb(r,g,b)" or "rgba(r,g,b,a)" syntax (e.g. {colour(255,0,0,85)} == "rgba(255,0,0,0.333)"), and {Wx::C2S_HTML_SYNTAX}, to obtain the colour as "#" followed by 6 hexadecimal digits (e.g. {colour(255,0,0)} == "\#FF0000").
# This function returns empty string if the colour is not initialized (see {Wx::Colour#is_ok}). Otherwise, the returned string is always non-empty, but the function asserts if the colour has alpha channel (i.e. is non opaque) but {Wx::C2S_CSS_SYNTAX} (which is the only one supporting alpha) is not specified in flags.
#
#
For non-solid (i.e. non-RGB) colour this function returns "rgb(??, ?? ??)" or "#??????". #
#