Class: Wx::ColourDatabase

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/gdi_common.rb

Overview

Note:

This class is untracked and should not be derived from nor instances extended!

wxWidgets maintains a database of standard RGB colours for a predefined set of named colours.

The application may add to this set if desired by using #add_colour and may use it to look up colours by names using #find or find the names for the standard colour using #find_name. There is one predefined, global instance of this class called TheColourDatabase. The standard database contains at least the following colours:

AQUAMARINE

BLACK

BLUE

BLUE VIOLET

BROWN

CADET BLUE

CORAL

CORNFLOWER BLUE

CYAN

DARK GREY

DARK GREEN

DARK OLIVE GREEN

DARK ORCHID

DARK SLATE BLUE

DARK SLATE GREY

DARK TURQUOISE

DIM GREY FIREBRICK

FOREST GREEN

GOLD

GOLDENROD

GREY

GREEN

GREEN YELLOW

INDIAN RED

KHAKI

LIGHT BLUE

LIGHT GREY

LIGHT STEEL BLUE

LIME GREEN

MAGENTA

MAROON

MEDIUM AQUAMARINE

MEDIUM BLUE MEDIUM FOREST GREEN

MEDIUM GOLDENROD

MEDIUM ORCHID

MEDIUM SEA GREEN

MEDIUM SLATE BLUE

MEDIUM SPRING GREEN

MEDIUM TURQUOISE

MEDIUM VIOLET RED

MIDNIGHT BLUE

NAVY

ORANGE

ORANGE RED

ORCHID

PALE GREEN

PINK

PLUM

PURPLE RED

SALMON

SEA GREEN

SIENNA

SKY BLUE

SLATE BLUE

SPRING GREEN

STEEL BLUE

TAN

THISTLE

TURQUOISE

VIOLET

VIOLET RED

WHEAT

WHITE

YELLOW

YELLOW GREEN

Category: Graphics Device Interface (GDI)

See Also:

Instance Method Summary collapse

Constructor Details

#initializeWx::ColourDatabase

Constructs the colour database.

It will be initialized at the first use.



1161
# File 'lib/wx/doc/gen/gdi_common.rb', line 1161

def initialize; end

Instance Method Details

#add_colour(colourName, colour) ⇒ void

This method returns an undefined value.

Adds a colour to the database.

If a colour with the same name already exists, it is replaced.

Parameters:

  • colourName (String)
  • colour (Wx::Colour, String, Symbol)


1169
# File 'lib/wx/doc/gen/gdi_common.rb', line 1169

def add_colour(colourName, colour) end

#find(colourName) ⇒ Wx::Colour

Finds a colour given the name.

Returns an invalid colour object (that is, Wx::Colour#is_ok will return false) if the colour wasn’t found in the database.

Parameters:

  • colourName (String)

Returns:



1176
# File 'lib/wx/doc/gen/gdi_common.rb', line 1176

def find(colourName) end

#find_name(colour) ⇒ String

Finds a colour name given the colour.

Returns an empty string if the colour is not found in the database.

Parameters:

Returns:

  • (String)


1183
# File 'lib/wx/doc/gen/gdi_common.rb', line 1183

def find_name(colour) end