Scribus
Open source desktop publishing at your fingertips
cmdcolor.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 #ifndef CMDCOLOR_H
8 #define CMDCOLOR_H
9 
10 // Pulls in <Python.h> first
11 #include "cmdvar.h"
12 
16 PyDoc_STRVAR(scribus_colornames__doc__,
17 QT_TR_NOOP("getColorNames() -> list\n\
18 \n\
19 Returns a list containing the names of all defined colors in the document.\n\
20 If no document is open, returns a list of the default document colors.\n\
21 "));
23 PyObject *scribus_colornames(PyObject * /*self*/);
24 
26 PyDoc_STRVAR(scribus_getcolor__doc__,
27 QT_TR_NOOP("getColor(\"name\") -> tuple\n\
28 \n\
29 Returns a tuple (C, M, Y, K) containing the four color components of the\n\
30 color \"name\" from the current document. If no document is open, returns\n\
31 the value of the named color from the default document colors.\n\
32 \n\
33 May raise NotFoundError if the named color wasn't found.\n\
34 May raise ValueError if an invalid color name is specified.\n\
35 "));
37 PyObject *scribus_getcolor(PyObject * /*self*/, PyObject* args);
38 
40 PyDoc_STRVAR(scribus_getcolorasrgb__doc__,
41 QT_TR_NOOP("getColorAsRGB(\"name\") -> tuple\n\
42 \n\
43 Returns a tuple (R,G,B) containing the three color components of the\n\
44 color \"name\" from the current document, converted to the RGB color\n\
45 space. If no document is open, returns the value of the named color\n\
46 from the default document colors.\n\
47 \n\
48 May raise NotFoundError if the named color wasn't found.\n\
49 May raise ValueError if an invalid color name is specified.\n\
50 "));
52 PyObject *scribus_getcolorasrgb(PyObject * /*self*/, PyObject* args);
53 
55 PyDoc_STRVAR(scribus_setcolor__doc__,
56 QT_TR_NOOP("changeColor(\"name\", c, m, y, k)\n\
57 \n\
58 Changes the color \"name\" to the specified CMYK value. The color value is\n\
59 defined via four components c = Cyan, m = Magenta, y = Yellow and k = Black.\n\
60 Color components should be in the range from 0 to 255.\n\
61 Note : deprecated, use changeColorCMYK() instead.\n\
62 \n\
63 May raise NotFoundError if the named color wasn't found.\n\
64 May raise ValueError if an invalid color name is specified.\n\
65 "));
67 PyObject *scribus_setcolor(PyObject * /*self*/, PyObject* args);
68 
70 PyDoc_STRVAR(scribus_setcolorcmyk__doc__,
71 QT_TR_NOOP("changeColorCMYK(\"name\", c, m, y, k)\n\
72 \n\
73 Changes the color \"name\" to the specified CMYK value. The color value is\n\
74 defined via four components c = Cyan, m = Magenta, y = Yellow and k = Black.\n\
75 Color components should be in the range from 0 to 255.\n\
76 \n\
77 May raise NotFoundError if the named color wasn't found.\n\
78 May raise ValueError if an invalid color name is specified.\n\
79 "));
81 PyObject *scribus_setcolorcmyk(PyObject * /*self*/, PyObject* args);
82 
84 PyDoc_STRVAR(scribus_setcolorrgb__doc__,
85 QT_TR_NOOP("changeColorRGB(\"name\", r, g, b)\n\
86 \n\
87 Changes the color \"name\" to the specified RGB value. The color value is\n\
88 defined via three components r = red, g = green, b = blue.\n\
89 Color components should be in the range from 0 to 255.\n\
90 \n\
91 May raise NotFoundError if the named color wasn't found.\n\
92 May raise ValueError if an invalid color name is specified.\n\
93 "));
95 PyObject *scribus_setcolorrgb(PyObject * /*self*/, PyObject* args);
96 
98 PyDoc_STRVAR(scribus_newcolor__doc__,
99 QT_TR_NOOP("defineColor(\"name\", c, m, y, k)\n\
100 \n\
101 Defines a new color \"name\". The color Value is defined via four components:\n\
102 c = Cyan, m = Magenta, y = Yellow and k = Black. Color components should be in\n\
103 the range from 0 to 255.\n\
104 Note : deprecated, use defineColorCMYK() instead.\n\
105 \n\
106 May raise ValueError if an invalid color name is specified.\n\
107 "));
109 PyObject *scribus_newcolor(PyObject * /*self*/, PyObject* args);
110 
112 PyDoc_STRVAR(scribus_newcolorcmyk__doc__,
113 QT_TR_NOOP("defineColorCMYK(\"name\", c, m, y, k)\n\
114 \n\
115 Defines a new color \"name\". The color Value is defined via four components:\n\
116 c = Cyan, m = Magenta, y = Yellow and k = Black. Color components should be in\n\
117 the range from 0 to 255.\n\
118 \n\
119 May raise ValueError if an invalid color name is specified.\n\
120 "));
122 PyObject *scribus_newcolorcmyk(PyObject * /*self*/, PyObject* args);
123 
125 PyDoc_STRVAR(scribus_newcolorrgb__doc__,
126 QT_TR_NOOP("defineColorRGB(\"name\", r, g, b)\n\
127 \n\
128 Defines a new color \"name\". The color Value is defined via three components:\n\
129 r = red, g = green, b = blue. Color components should be in\n\
130 the range from 0 to 255.\n\
131 \n\
132 May raise ValueError if an invalid color name is specified.\n\
133 "));
135 PyObject *scribus_newcolorrgb(PyObject * /*self*/, PyObject* args);
136 
138 PyDoc_STRVAR(scribus_delcolor__doc__,
139 QT_TR_NOOP("deleteColor(\"name\", \"replace\")\n\
140 \n\
141 Deletes the color \"name\". Every occurence of that color is replaced by the\n\
142 color \"replace\". If not specified, \"replace\" defaults to the color\n\
143 \"None\" - transparent.\n\
144 \n\
145 deleteColor works on the default document colors if there is no document open.\n\
146 In that case, \"replace\", if specified, has no effect.\n\
147 \n\
148 May raise NotFoundError if a named color wasn't found.\n\
149 May raise ValueError if an invalid color name is specified.\n\
150 "));
152 PyObject *scribus_delcolor(PyObject * /*self*/, PyObject* args);
153 
155 PyDoc_STRVAR(scribus_replcolor__doc__,
156 QT_TR_NOOP("replaceColor(\"name\", \"replace\")\n\
157 \n\
158 Every occurence of the color \"name\" is replaced by the color \"replace\".\n\
159 \n\
160 May raise NotFoundError if a named color wasn't found.\n\
161 May raise ValueError if an invalid color name is specified.\n\
162 "));
164 PyObject *scribus_replcolor(PyObject * /*self*/, PyObject* args);
165 
166 
168 PyDoc_STRVAR(scribus_isspotcolor__doc__,
169 QT_TR_NOOP("isSpotColor(\"name\") -> bool\n\
170 \n\
171 Returns True if the color \"name\" is a spot color.\n\
172 See also setSpotColor()\n\
173 \n\
174 May raise NotFoundError if a named color wasn't found.\n\
175 May raise ValueError if an invalid color name is specified.\n\
176 "));
178 PyObject *scribus_isspotcolor(PyObject * /*self*/, PyObject* args);
179 
180 
181 
183 PyDoc_STRVAR(scribus_setspotcolor__doc__,
184 QT_TR_NOOP("setSpotColor(\"name\", spot)\n\
185 \n\
186 Set the color \"name\" as a spot color if spot parameter is True.\n\
187 See also isSpotColor()\n\
188 \n\
189 May raise NotFoundError if a named color wasn't found.\n\
190 May raise ValueError if an invalid color name is specified.\n\
191 "));
193 PyObject *scribus_setspotcolor(PyObject * /*self*/, PyObject* args);
194 
195 #endif
196 
197