summaryrefslogtreecommitdiffstats
path: root/generic/tkColor.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-07-16 12:36:40 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-07-16 12:36:40 (GMT)
commitf4db69f3300fe5cdb3da35c67bf608674950a72c (patch)
tree83188d92aa77a52a178e0ae85ba5439c402f4eca /generic/tkColor.c
parent8f22ecfac96ac10f3c1aa3df10a10071ed591d9b (diff)
downloadtk-f4db69f3300fe5cdb3da35c67bf608674950a72c.zip
tk-f4db69f3300fe5cdb3da35c67bf608674950a72c.tar.gz
tk-f4db69f3300fe5cdb3da35c67bf608674950a72c.tar.bz2
Working towards adding all the Tcl_SetErrorCode calls that should be there.
** WORK IN PROGRESS **
Diffstat (limited to 'generic/tkColor.c')
-rw-r--r--generic/tkColor.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tkColor.c b/generic/tkColor.c
index 9383a92..b1ed4f1 100644
--- a/generic/tkColor.c
+++ b/generic/tkColor.c
@@ -226,9 +226,11 @@ Tk_GetColor(
if (*name == '#') {
Tcl_AppendResult(interp, "invalid color name \"", name,
"\"", NULL);
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "COLOR", NULL);
} else {
Tcl_AppendResult(interp, "unknown color name \"", name,
"\"", NULL);
+ Tcl_SetErrorCode(interp, "TK", "LOOKUP", "COLOR", name, NULL);
}
}
if (isNew) {
@@ -372,10 +374,12 @@ Tk_NameOfColor(
sprintf(tsdPtr->rgbString, "#%04x%04x%04x", colorPtr->red,
colorPtr->green, colorPtr->blue);
- /* If the string has the form #RSRSTUTUVWVW (where equal
- * letters denote equal hexdigits) then this is
- * equivalent to #RSTUVW. Then output the shorter form.
+ /*
+ * If the string has the form #RSRSTUTUVWVW (where equal letters
+ * denote equal hexdigits) then this is equivalent to #RSTUVW. Then
+ * output the shorter form.
*/
+
if ((tsdPtr->rgbString[1] == tsdPtr->rgbString[3])
&& (tsdPtr->rgbString[2] == tsdPtr->rgbString[4])
&& (tsdPtr->rgbString[5] == tsdPtr->rgbString[7])