r14804 by jghali - #8868: new changeColorRGB() and defineColorRGB() script tokens

scribus-commit scribus-commit at lists.scribus.net
Wed Feb 24 00:40:35 CET 2010


Revision: 14804
Author: jghali
Date: 2010-02-23T23:37:23.080132Z
Commit message: #8868: new changeColorRGB() and defineColorRGB() script tokens

Changeset: 
M  /trunk/Scribus/scribus/colormgmt/sccolormgmtstructs.h
M  /trunk/Scribus/scribus/plugins/scriptplugin/cmdcolor.h
M  /trunk/Scribus/doc/en/scripterapi-color.html
M  /trunk/Scribus/doc/fr/scripterapi-color.html
M  /trunk/Scribus/scribus/plugins/scriptplugin/cmdcolor.cpp
M  /trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp

Diffs:
Index: doc/en/scripterapi-color.html
===================================================================
--- doc/en/scripterapi-color.html	(revision 14803)
+++ doc/en/scripterapi-color.html	(revision 14804)
@@ -11,13 +11,35 @@
 <dt><a name="-changeColor"><strong>changeColor</strong></a>(...)</dt>
 <dd><code>changeColor("name", c, m, y, k)</code>
 <p>Changes the color "name" to the specified CMYK value. The color value is defined via four components c = Cyan, m = Magenta, y = Yellow and k = Black. Color components should be in the range from 0 to 255.</p>
+<p>Note : deprecated, use changeColorCMYK() instead</p>
 <p>May raise <a href="scripterapi.html#NotFoundError">NotFoundError</a> if the named color wasn't found. May raise ValueError if an invalid color name is specified.</p></dd>
 
+<dt><a name="-changeColorRGB"><strong>changeColorRGB</strong></a>(...)</dt>
+<dd><code>changeColorRGB("name", r, g, b)</code>
+<p>Changes the color "name" to the specified RGB value. The color value is defined via three components r = red, g = green, b = blue. Color components should be in the range from 0 to 255.</p>
+<p>May raise <a href="scripterapi.html#NotFoundError">NotFoundError</a> if the named color wasn't found. May raise ValueError if an invalid color name is specified.</p></dd>
+
+<dt><a name="-changeColorCMYK"><strong>changeColorCMYK</strong></a>(...)</dt>
+<dd><code>changeColorCMYK("name", c, m, y, k)</code>
+<p>Changes the color "name" to the specified CMYK value. The color value is defined via four components c = Cyan, m = Magenta, y = Yellow and k = Black. Color components should be in the range from 0 to 255.</p>
+<p>May raise <a href="scripterapi.html#NotFoundError">NotFoundError</a> if the named color wasn't found. May raise ValueError if an invalid color name is specified.</p></dd>
+
 <dt><a name="-defineColor"><strong>defineColor</strong></a>(...)</dt>
 <dd><code>defineColor("name", c, m, y, k)</code>
-<p>Defines a new color "name". The color Value is defined via four components: c = Cyan, m = Magenta, y = Yellow and k = Black. Color components should be in the range from 0 to 255.</p>
+<p>Defines a new color "name". The color Value is defined via three components: c = Cyan, m = Magenta, y = Yellow and k = Black. Color components should be in the range from 0 to 255.</p>
+<p>Note : deprecated, use defineColorCMYK() instead.</p>
 <p>May raise ValueError if an invalid color name is specified.</p></dd>
 
+<dt><a name="-defineColorRGB"><strong>defineColorRGB</strong></a>(...)</dt>
+<dd><code>defineColorRGB("name", r, g, b)</code>
+<p>Defines a new color "name". The color Value is defined via three components: r = red, g = green, b = blue. Color components should be in the range from 0 to 255.</p>
+<p>May raise ValueError if an invalid color name is specified.</p></dd>
+
+<dt><a name="-defineColorCMYK"><strong>defineColorCMYK</strong></a>(...)</dt>
+<dd><code>defineColorCMYK("name", c, m, y, k)</code>
+<p>Defines a new color "name". The color Value is defined via three components: c = Cyan, m = Magenta, y = Yellow and k = Black. Color components should be in the range from 0 to 255.</p>
+<p>May raise ValueError if an invalid color name is specified.</p></dd>
+
 <dt><a name="-deleteColor"><strong>deleteColor</strong></a>(...)</dt>
 <dd><code>deleteColor("name", "replace")</code>
 <p>Deletes the color "name". Every occurence of that color is replaced by the color "replace". If not specified, "replace" defaults to the color "None" - transparent.</p>
Index: doc/fr/scripterapi-color.html
===================================================================
--- doc/fr/scripterapi-color.html	(revision 14803)
+++ doc/fr/scripterapi-color.html	(revision 14804)
@@ -12,15 +12,43 @@
 <dd><code><a href="#-changeColor">changeColor</a>("nom", c, m, j, n)</code>
 <p>Change la couleur "nom" pour la valeur CMJN sp&eacute;cifi&eacute;e. La valeur de la couleur est d&eacute;finie par quatre composants c = Cyan, m = Magenta, j = Jaune et n = Noir. 
 Les composants de la couleur doivent se situer entre 0 et 255.</p>
+<p>Note : cette fonction sera supprim&eacute;e dans une version ult&eacute;rieure, veuillez utiliser changeColorCMYK() &agrave; la place.</p>
 <p>Peut g&eacute;n&eacute;rer <a href="scripterapi.html#NotFoundError">NotFoundError</a> si la couleur nomm&eacute;e est introuvable.
 Peut g&eacute;n&eacute;rer ValueError si le nom de couleur sp&eacute;cifi&eacute; n'est pas valide.</p></dd>
 
+<dt><a name="-changeColorRGB"><strong>changeColorRGB</strong></a>(...)</dt>
+<dd><code><a href="#-changeColorRGB">changeColorRGB</a>("nom", r, v, b)</code>
+<p>Change la couleur "nom" pour la valeur RVB sp&eacute;cifi&eacute;e. La valeur de la couleur est d&eacute;finie par trois composants r = rouge, v = vert, b = bleu. 
+Les composants de la couleur doivent se situer entre 0 et 255.</p>
+<p>Peut g&eacute;n&eacute;rer <a href="scripterapi.html#NotFoundError">NotFoundError</a> si la couleur nomm&eacute;e est introuvable.
+Peut g&eacute;n&eacute;rer ValueError si le nom de couleur sp&eacute;cifi&eacute; n'est pas valide.</p></dd>
+
+<dt><a name="-changeColorCMYK"><strong>changeColorCMYK</strong></a>(...)</dt>
+<dd><code><a href="#-changeColorCMYK">changeColorCMYK</a>("nom", c, m, j, n)</code>
+<p>Change la couleur "nom" pour la valeur CMJN sp&eacute;cifi&eacute;e. La valeur de la couleur est d&eacute;finie par quatre composants c = Cyan, m = Magenta, j = Jaune et n = Noir. 
+Les composants de la couleur doivent se situer entre 0 et 255.</p>
+<p>Peut g&eacute;n&eacute;rer <a href="scripterapi.html#NotFoundError">NotFoundError</a> si la couleur nomm&eacute;e est introuvable.
+Peut g&eacute;n&eacute;rer ValueError si le nom de couleur sp&eacute;cifi&eacute; n'est pas valide.</p></dd>
+
 <dt><a name="-defineColor"><strong>defineColor</strong></a>(...)</dt>
 <dd><code><a href="#-defineColor">defineColor</a>("nom", c, m, j, n)</code>
 <p>D&eacute;finit une nouvelle couleur "nom". La valeur de la couleur est
 d&eacute;finie par quatre composants : c = Cyan, m = Magenta, j = Jaune et n = Noir. Les composants de la couleur doivent se situer entre 0 et 255.</p>
+<p>Note : cette fonction sera supprim&eacute;e dans une version ult&eacute;rieure, veuillez utiliser defineColorCMYK() &agrave; la place.</p>
 <p>Peut g&eacute;n&eacute;rer ValueError si le nom de couleur sp&eacute;cifi&eacute; n'est pas valide.</p></dd>
 
+<dt><a name="-defineColorCMYK"><strong>defineColorCMYK</strong></a>(...)</dt>
+<dd><code><a href="#-defineColorCMYK">defineColorCMYK</a>("nom", c, m, j, n)</code>
+<p>D&eacute;finit une nouvelle couleur "nom". La valeur de la couleur est
+d&eacute;finie par quatre composants : c = Cyan, m = Magenta, j = Jaune et n = Noir. Les composants de la couleur doivent se situer entre 0 et 255.</p>
+<p>Peut g&eacute;n&eacute;rer ValueError si le nom de couleur sp&eacute;cifi&eacute; n'est pas valide.</p></dd>
+
+<dt><a name="-defineColorRGB"><strong>defineColorRGB</strong></a>(...)</dt>
+<dd><code><a href="#-defineColorRGB">defineColorRGB</a>("nom", r, v, b)</code>
+<p>D&eacute;finit une nouvelle couleur "nom". La valeur de la couleur est
+d&eacute;finie par trois composants : r = rouge, v = vert, b = bleu. Les composants de la couleur doivent se situer entre 0 et 255.</p>
+<p>Peut g&eacute;n&eacute;rer ValueError si le nom de couleur sp&eacute;cifi&eacute; n'est pas valide.</p></dd>
+
 <dt><a name="-deleteColor"><strong>deleteColor</strong></a>(...)</dt>
 <dd><code><a href="#-deleteColor">deleteColor</a>("nom", "remplacement")</code>
 <p>Supprime la couleur "nom". Chaque occurrence de cette couleur est remplac&eacute;e par la couleur dite de "remplacement". Si elle n'est pas sp&eacute;cifi&eacute;e, "remplacement" prendra par d&eacute;faut la valeur "none" - transparente.</p>
Index: scribus/colormgmt/sccolormgmtstructs.h
===================================================================
--- scribus/colormgmt/sccolormgmtstructs.h	(revision 14803)
+++ scribus/colormgmt/sccolormgmtstructs.h	(revision 14804)
@@ -60,32 +60,32 @@
 	Intent_Max = 4
 } eRenderIntent;
 
-typedef enum 
-{
-	ColorSpace_Unknown,
-    ColorSpace_XYZ,
-    ColorSpace_Lab,
-    ColorSpace_Luv,
-    ColorSpace_YCbCr,
-    ColorSpace_Yxy,
-    ColorSpace_Rgb,
-    ColorSpace_Gray,
-    ColorSpace_Hsv,
-    ColorSpace_Hls,
-    ColorSpace_Cmyk,
-    ColorSpace_Cmy
+typedef enum 
+{
+	ColorSpace_Unknown,
+    ColorSpace_XYZ,
+    ColorSpace_Lab,
+    ColorSpace_Luv,
+    ColorSpace_YCbCr,
+    ColorSpace_Yxy,
+    ColorSpace_Rgb,
+    ColorSpace_Gray,
+    ColorSpace_Hsv,
+    ColorSpace_Hls,
+    ColorSpace_Cmyk,
+    ColorSpace_Cmy
 } eColorSpaceType;
 
-typedef enum 
-{
-	Class_Unknown,
-    Class_Input,
-    Class_Display,
-    Class_Output,
-    Class_Link,
-    Class_Abstract,
-    Class_ColorSpace,
-    Class_NamedColor
+typedef enum 
+{
+	Class_Unknown,
+    Class_Input,
+    Class_Display,
+    Class_Output,
+    Class_Link,
+    Class_Abstract,
+    Class_ColorSpace,
+    Class_NamedColor
 } eProfileClass;
 
 class ScColorMgmtStrategy
Index: scribus/plugins/scriptplugin/cmdcolor.h
===================================================================
--- scribus/plugins/scriptplugin/cmdcolor.h	(revision 14803)
+++ scribus/plugins/scriptplugin/cmdcolor.h	(revision 14804)
@@ -58,6 +58,7 @@
 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\
+Note : deprecated, use changeColorCMYK() instead.\n\
 \n\
 May raise NotFoundError if the named color wasn't found.\n\
 May raise ValueError if an invalid color name is specified.\n\
@@ -66,12 +67,41 @@
 PyObject *scribus_setcolor(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
+PyDoc_STRVAR(scribus_setcolorcmyk__doc__,
+QT_TR_NOOP("changeColorCMYK(\"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_setcolorcmyk(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_setcolorrgb__doc__,
+QT_TR_NOOP("changeColorRGB(\"name\", r, g, b)\n\
+\n\
+Changes the color \"name\" to the specified RGB value. The color value is\n\
+defined via three components r = red, g = green, b = blue.\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 R, G, B params. */
+PyObject *scribus_setcolorrgb(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\
+Note : deprecated, use defineColorCMYK() instead.\n\
 \n\
 May raise ValueError if an invalid color name is specified.\n\
 "));
@@ -79,6 +109,32 @@
 PyObject *scribus_newcolor(PyObject * /*self*/, PyObject* args);
 
 /*! docstring */
+PyDoc_STRVAR(scribus_newcolorcmyk__doc__,
+QT_TR_NOOP("defineColorCMYK(\"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_newcolorcmyk(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
+PyDoc_STRVAR(scribus_newcolorrgb__doc__,
+QT_TR_NOOP("defineColorRGB(\"name\", r, g, b)\n\
+\n\
+Defines a new color \"name\". The color Value is defined via three components:\n\
+r = red, g = green, b = blue. 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, R, G, B params. */
+PyObject *scribus_newcolorrgb(PyObject * /*self*/, PyObject* args);
+
+/*! docstring */
 PyDoc_STRVAR(scribus_delcolor__doc__,
 QT_TR_NOOP("deleteColor(\"name\", \"replace\")\n\
 \n\
@@ -138,3 +194,4 @@
 
 #endif
 
+
Index: scribus/plugins/scriptplugin/cmdcolor.cpp
===================================================================
--- scribus/plugins/scriptplugin/cmdcolor.cpp	(revision 14803)
+++ scribus/plugins/scriptplugin/cmdcolor.cpp	(revision 14804)
@@ -77,8 +77,13 @@
 	return Py_BuildValue("(iii)", static_cast<long>(rgb.red()), static_cast<long>(rgb.green()), static_cast<long>(rgb.blue()));
 }
 
-PyObject *scribus_setcolor(PyObject* /* self */, PyObject* args)
+PyObject *scribus_setcolor(PyObject*  self, PyObject* args)
 {
+	return scribus_setcolorcmyk(self, args);
+}
+
+PyObject *scribus_setcolorcmyk(PyObject* /* self */, PyObject* args)
+{
 	char *Name = const_cast<char*>("");
 	int c, m, y, k;
 	if (!PyArg_ParseTuple(args, "esiiii", "utf-8", &Name, &c, &m, &y, &k))
@@ -113,42 +118,119 @@
 	Py_RETURN_NONE;
 }
 
-PyObject *scribus_newcolor(PyObject* /* self */, PyObject* args)
+PyObject *scribus_setcolorrgb(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
-	int c, m, y, k;
-	if (!PyArg_ParseTuple(args, "esiiii", "utf-8", &Name, &c, &m, &y, &k))
+	int r, g, b;
+	if (!PyArg_ParseTuple(args, "esiii", "utf-8", &Name, &r, &g, &b))
 		return NULL;
 	if (strcmp(Name, "") == 0)
 	{
-		PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot create a color with an empty name.","python error").toLocal8Bit().constData());
+		PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot change a color with an empty name.","python error").toLocal8Bit().constData());
 		return NULL;
 	}
 	QString col = QString::fromUtf8(Name);
 	if (ScCore->primaryMainWindow()->HaveDoc)
+	{
+		if (!ScCore->primaryMainWindow()->doc->PageColors.contains(col))
 		{
-			if (!ScCore->primaryMainWindow()->doc->PageColors.contains(col))
-				ScCore->primaryMainWindow()->doc->PageColors.insert(col, ScColor(c, m, y, k));
-			else
-				// FIXME: Given that we have a changeColour function, should we really be
-				// silently changing colours in newColour?
-				ScCore->primaryMainWindow()->doc->PageColors[col].setColor(c, m, y, k);
+			PyErr_SetString(NotFoundError, QObject::tr("Color not found in document.","python error").toLocal8Bit().constData());
+			return NULL;
 		}
+		ScCore->primaryMainWindow()->doc->PageColors[col].setColorRGB(r, g, b);
+	}
 	else
+	{
+		ColorList* colorList=PrefsManager::instance()->colorSetPtr();
+		if (!colorList->contains(col))
 		{
-			ColorList* colorList=PrefsManager::instance()->colorSetPtr();
-			if (!colorList->contains(col))
-				colorList->insert(col, ScColor(c, m, y, k));
-			else
-				// FIXME: Given that we have a changeColour function, should we really be
-				// silently changing colours in newColour?
-				(*colorList)[col].setColor(c, m, y, k);
+			PyErr_SetString(NotFoundError, QObject::tr("Color not found in default colors.","python error").toLocal8Bit().constData());
+			return NULL;
 		}
+		(*colorList)[col].setColorRGB(r, g, b);
+	}
+// 	Py_INCREF(Py_None);
+// 	return Py_None;
+	Py_RETURN_NONE;
+}
+
+PyObject *scribus_newcolor(PyObject* self, PyObject* args)
+{
+	return scribus_newcolorcmyk(self, args);
+}
+
+PyObject *scribus_newcolorcmyk(PyObject* /* self */, PyObject* args)
+{
+	char *Name = const_cast<char*>("");
+	int c, m, y, k;
+	if (!PyArg_ParseTuple(args, "esiiii", "utf-8", &Name, &c, &m, &y, &k))
+		return NULL;
+	if (strcmp(Name, "") == 0)
+	{
+		PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot create a color with an empty name.","python error").toLocal8Bit().constData());
+		return NULL;
+	}
+	QString col = QString::fromUtf8(Name);
+	if (ScCore->primaryMainWindow()->HaveDoc)
+	{
+		if (!ScCore->primaryMainWindow()->doc->PageColors.contains(col))
+			ScCore->primaryMainWindow()->doc->PageColors.insert(col, ScColor(c, m, y, k));
+		else
+			// FIXME: Given that we have a changeColour function, should we really be
+			// silently changing colours in newColour?
+			ScCore->primaryMainWindow()->doc->PageColors[col].setColor(c, m, y, k);
+	}
+	else
+	{
+		ColorList* colorList=PrefsManager::instance()->colorSetPtr();
+		if (!colorList->contains(col))
+			colorList->insert(col, ScColor(c, m, y, k));
+		else
+			// FIXME: Given that we have a changeColour function, should we really be
+			// silently changing colours in newColour?
+			(*colorList)[col].setColor(c, m, y, k);
+	}
  //	Py_INCREF(Py_None);
  //	return Py_None;
 	Py_RETURN_NONE;
 }
 
+PyObject *scribus_newcolorrgb(PyObject* /* self */, PyObject* args)
+{
+	char *Name = const_cast<char*>("");
+	int r, g, b;
+	if (!PyArg_ParseTuple(args, "esiii", "utf-8", &Name, &r, &g, &b))
+		return NULL;
+	if (strcmp(Name, "") == 0)
+	{
+		PyErr_SetString(PyExc_ValueError, QObject::tr("Cannot create a color with an empty name.","python error").toLocal8Bit().constData());
+		return NULL;
+	}
+	QString col = QString::fromUtf8(Name);
+	if (ScCore->primaryMainWindow()->HaveDoc)
+	{
+		if (!ScCore->primaryMainWindow()->doc->PageColors.contains(col))
+			ScCore->primaryMainWindow()->doc->PageColors.insert(col, ScColor(r, g, b));
+		else
+			// FIXME: Given that we have a changeColour function, should we really be
+			// silently changing colours in newColour?
+			ScCore->primaryMainWindow()->doc->PageColors[col].setColorRGB(r, g, b);
+	}
+	else
+	{
+		ColorList* colorList=PrefsManager::instance()->colorSetPtr();
+		if (!colorList->contains(col))
+			colorList->insert(col, ScColor(r, g, b));
+		else
+			// FIXME: Given that we have a changeColour function, should we really be
+			// silently changing colours in newColour?
+			(*colorList)[col].setColorRGB(r, g, b);
+	}
+ //	Py_INCREF(Py_None);
+ //	return Py_None;
+	Py_RETURN_NONE;
+}
+
 PyObject *scribus_delcolor(PyObject* /* self */, PyObject* args)
 {
 	char *Name = const_cast<char*>("");
@@ -165,10 +247,10 @@
 	if (ScCore->primaryMainWindow()->HaveDoc)
 	{
 		if (ScCore->primaryMainWindow()->doc->PageColors.contains(col) && (ScCore->primaryMainWindow()->doc->PageColors.contains(rep) || (rep == CommonStrings::None)))
-			{
-				ScCore->primaryMainWindow()->doc->PageColors.remove(col);
-				ReplaceColor(col, rep);
-			}
+		{
+			ScCore->primaryMainWindow()->doc->PageColors.remove(col);
+			ReplaceColor(col, rep);
+		}
 		else
 		{
 			PyErr_SetString(NotFoundError, QObject::tr("Color not found in document.","python error").toLocal8Bit().constData());
@@ -281,6 +363,6 @@
 {
     QStringList s;
     s << scribus_colornames__doc__ << scribus_getcolor__doc__ << scribus_getcolorasrgb__doc__;
-    s << scribus_setcolor__doc__ << scribus_newcolor__doc__ << scribus_delcolor__doc__;
+    s << scribus_setcolor__doc__ << scribus_newcolor__doc__ << scribus_newcolorrgb__doc__ << scribus_delcolor__doc__;
 	s << scribus_replcolor__doc__ << scribus_isspotcolor__doc__ << scribus_setspotcolor__doc__;
 }
Index: scribus/plugins/scriptplugin/scriptplugin.cpp
===================================================================
--- scribus/plugins/scriptplugin/scriptplugin.cpp	(revision 14803)
+++ scribus/plugins/scriptplugin/scriptplugin.cpp	(revision 14804)
@@ -297,6 +297,8 @@
 	// 2004/10/03 pv - aliases with common Python syntax - ClassName methodName
 	// 2004-11-06 cr - move aliasing to dynamically generated wrapper functions, sort methoddef
 	{const_cast<char*>("changeColor"), scribus_setcolor, METH_VARARGS, tr(scribus_setcolor__doc__)},
+	{const_cast<char*>("changeColorRGB"), scribus_setcolorrgb, METH_VARARGS, tr(scribus_setcolorrgb__doc__)},
+	{const_cast<char*>("changeColorCMYK"), scribus_setcolorcmyk, METH_VARARGS, tr(scribus_setcolorcmyk__doc__)},
 	{const_cast<char*>("closeDoc"), (PyCFunction)scribus_closedoc, METH_NOARGS, tr(scribus_closedoc__doc__)},
 	{const_cast<char*>("closeMasterPage"), (PyCFunction)scribus_closemasterpage, METH_NOARGS, tr(scribus_closemasterpage__doc__)},
 	{const_cast<char*>("createBezierLine"), scribus_bezierline, METH_VARARGS, tr(scribus_bezierline__doc__)},
@@ -314,6 +316,8 @@
 	{const_cast<char*>("createCharStyle"), (PyCFunction)scribus_createcharstyle, METH_KEYWORDS, tr(scribus_createcharstyle__doc__)},
 	{const_cast<char*>("currentPage"), (PyCFunction)scribus_actualpage, METH_NOARGS, tr(scribus_actualpage__doc__)},
 	{const_cast<char*>("defineColor"), scribus_newcolor, METH_VARARGS, tr(scribus_newcolor__doc__)},
+	{const_cast<char*>("defineColorRGB"), scribus_newcolorrgb, METH_VARARGS, tr(scribus_newcolorrgb__doc__)},
+	{const_cast<char*>("defineColorCMYK"), scribus_newcolorcmyk, METH_VARARGS, tr(scribus_newcolorcmyk__doc__)},
 	{const_cast<char*>("deleteColor"), scribus_delcolor, METH_VARARGS, tr(scribus_delcolor__doc__)},
 	{const_cast<char*>("deleteLayer"), scribus_removelayer, METH_VARARGS, tr(scribus_removelayer__doc__)},
 	{const_cast<char*>("deleteMasterPage"), scribus_deletemasterpage, METH_VARARGS, tr(scribus_deletemasterpage__doc__)},




More information about the scribus-commit mailing list