1wxPalette(3)               Erlang Module Definition               wxPalette(3)
2
3
4

NAME

6       wxPalette - Functions for wxPalette class
7

DESCRIPTION

9       A  palette  is a table that maps pixel values to RGB colours. It allows
10       the colours of a low-depth bitmap, for example, to  be  mapped  to  the
11       available colours in a display. The notion of palettes is becoming more
12       and more obsolete nowadays and only the MSW port is still using  a  na‐
13       tive  palette. All other ports use generic code which is basically just
14       an array of colours.
15
16       It is likely that in the future the only use for palettes within wxWid‐
17       gets  will  be for representing colour indices from images (such as GIF
18       or PNG). The image handlers for these formats  have  been  modified  to
19       create  a  palette  if  there is such information in the original image
20       file (usually 256 or less colour images). See wxImage for more informa‐
21       tion.
22
23       Predefined objects (include wx.hrl): ?wxNullPalette
24
25       See: wxDC:setPalette/2, wxBitmap
26
27       wxWidgets docs: wxPalette
28

DATA TYPES

30       wxPalette() = wx:wx_object()
31

EXPORTS

33       new() -> wxPalette()
34
35              Default constructor.
36
37       new(Palette) -> wxPalette()
38
39              Types:
40
41                 Palette = wxPalette()
42
43              Copy constructor, uses overview_refcount.
44
45       new(Red, Green, Blue) -> wxPalette()
46
47              Types:
48
49                 Red = Green = Blue = binary()
50
51              Creates  a palette from arrays of size n, one for each red, blue
52              or green component.
53
54              See: create/4
55
56       destroy(This :: wxPalette()) -> ok
57
58              Destructor.
59
60              See: reference-counted object destruction
61
62       create(This, Red, Green, Blue) -> boolean()
63
64              Types:
65
66                 This = wxPalette()
67                 Red = Green = Blue = binary()
68
69              Creates a palette from arrays of size n, one for each red,  blue
70              or green component.
71
72              Return: true if the creation was successful, false otherwise.
73
74              See: new/3
75
76       getColoursCount(This) -> integer()
77
78              Types:
79
80                 This = wxPalette()
81
82              Returns number of entries in palette.
83
84       getPixel(This, Red, Green, Blue) -> integer()
85
86              Types:
87
88                 This = wxPalette()
89                 Red = Green = Blue = integer()
90
91              Returns a pixel value (index into the palette) for the given RGB
92              values.
93
94              Return: The nearest palette index or wxNOT_FOUND for  unexpected
95              errors.
96
97              See: getRGB/2
98
99       getRGB(This, Pixel) -> Result
100
101              Types:
102
103                 Result =
104                     {Res :: boolean(),
105                      Red :: integer(),
106                      Green :: integer(),
107                      Blue :: integer()}
108                 This = wxPalette()
109                 Pixel = integer()
110
111              Returns RGB values for a given palette index.
112
113              Return: true if the operation was successful.
114
115              See: getPixel/4
116
117       ok(This) -> boolean()
118
119              Types:
120
121                 This = wxPalette()
122
123              See: isOk/1.
124
125       isOk(This) -> boolean()
126
127              Types:
128
129                 This = wxPalette()
130
131              Returns true if palette data is present.
132
133
134
135wxWidgets team.                    wx 2.3.1                       wxPalette(3)
Impressum