summaryrefslogtreecommitdiffstats
path: root/scribus/plugins/scriptplugin/cmdcolor.h
blob: bf3f5514afb8793f98699dbb8757ea6dfbfcf1ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
#ifndef CMDCOLOR_H
#define CMDCOLOR_H

// Pulls in <Python.h> first
#include "cmdvar.h"

/** Managing Colors */

/*! docstring */
PyDoc_STRVAR(scribus_colornames__doc__,
QT_TR_NOOP("getColorNames() -> list\n\
\n\
Returns a list containing the names of all defined colors in the document.\n\
If no document is open, returns a list of the default document colors.\n\
"));
/** Returns a list with colours available in doc or in prefs. */
PyObject *scribus_colornames(PyObject * /*self*/);

/*! docstring */
PyDoc_STRVAR(scribus_getcolor__doc__,
QT_TR_NOOP("getColor(\"name\") -> tuple\n\
\n\
Returns a tuple (C, M, Y, K) containing the four color components of the\n\
color \"name\" from the current document. If no document is open, returns\n\
the value of the named color from the default document colors.\n\
\n\
May raise NotFoundError if the named color wasn't found.\n\
May raise ValueError if an invalid color name is specified.\n\
"));
/** Returns a CMYK tuple of the specified color. */
PyObject *scribus_getcolor(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_getcolorasrgb__doc__,
QT_TR_NOOP("getColorAsRGB(\"name\") -> tuple\n\
\n\
Returns a tuple (R,G,B) containing the three color components of the\n\
color \"name\" from the current document, converted to the RGB color\n\
space. If no document is open, returns the value of the named color\n\
from the default document colors.\n\
\n\
May raise NotFoundError if the named color wasn't found.\n\
May raise ValueError if an invalid color name is specified.\n\
"));
/** Returns a CMYK tuple of the specified color. */
PyObject *scribus_getcolorasrgb(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_setcolor__doc__,
QT_TR_NOOP("changeColor(\"name\", c, m, y, k)\n\
\n\
Changes the color \"name\" to the specified CMYK value. The color value is\n\
defined via four components c = Cyan, m = Magenta, y = Yellow and k = Black.\n\
Color components should be in the range from 0 to 255.\n\
\n\
May raise NotFoundError if the named color wasn't found.\n\
May raise ValueError if an invalid color name is specified.\n\
"));
/** Sets named color with C,M,Y,K params. */
PyObject *scribus_setcolor(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_newcolor__doc__,
QT_TR_NOOP("defineColor(\"name\", c, m, y, k)\n\
\n\
Defines a new color \"name\". The color Value is defined via four components:\n\
c = Cyan, m = Magenta, y = Yellow and k = Black. Color components should be in\n\
the range from 0 to 255.\n\
\n\
May raise ValueError if an invalid color name is specified.\n\
"));
/** Creates new color with name, C, M, Y, K params. */
PyObject *scribus_newcolor(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_delcolor__doc__,
QT_TR_NOOP("deleteColor(\"name\", \"replace\")\n\
\n\
Deletes the color \"name\". Every occurence of that color is replaced by the\n\
color \"replace\". If not specified, \"replace\" defaults to the color\n\
\"None\" - transparent.\n\
\n\
deleteColor works on the default document colors if there is no document open.\n\
In that case, \"replace\", if specified, has no effect.\n\
\n\
May raise NotFoundError if a named color wasn't found.\n\
May raise ValueError if an invalid color name is specified.\n\
"));
/** Deletes named color */
PyObject *scribus_delcolor(PyObject * /*self*/, PyObject* args);

/*! docstring */
PyDoc_STRVAR(scribus_replcolor__doc__,
QT_TR_NOOP("replaceColor(\"name\", \"replace\")\n\
\n\
Every occurence of the color \"name\" is replaced by the color \"replace\".\n\
\n\
May raise NotFoundError if a named color wasn't found.\n\
May raise ValueError if an invalid color name is specified.\n\
"));
/** Replaces color with the 2nd one. */
PyObject *scribus_replcolor(PyObject * /*self*/, PyObject* args);


/*! docstring */
PyDoc_STRVAR(scribus_isspotcolor__doc__,
QT_TR_NOOP("isSpotColor(\"name\") -> bool\n\
\n\
Returns True if the color \"name\" is a spot color.\n\
See also setSpotColor()\n\
\n\
May raise NotFoundError if a named color wasn't found.\n\
May raise ValueError if an invalid color name is specified.\n\
"));
/** Replaces color with the 2nd one. */
PyObject *scribus_isspotcolor(PyObject * /*self*/, PyObject* args);



/*! docstring */
PyDoc_STRVAR(scribus_setspotcolor__doc__,
QT_TR_NOOP("setSpotColor(\"name\", spot)\n\
\n\
Set the color \"name\" as a spot color if spot parameter is True.\n\
See also isSpotColor()\n\
\n\
May raise NotFoundError if a named color wasn't found.\n\
May raise ValueError if an invalid color name is specified.\n\
"));
/** Replaces color with the 2nd one. */
PyObject *scribus_setspotcolor(PyObject * /*self*/, PyObject* args);

#endif