summaryrefslogtreecommitdiffstats
path: root/generic/tkColor.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkColor.c')
-rw-r--r--generic/tkColor.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/generic/tkColor.c b/generic/tkColor.c
index ea03e28..e4fa3f7 100644
--- a/generic/tkColor.c
+++ b/generic/tkColor.c
@@ -224,11 +224,13 @@ Tk_GetColor(
if (tkColPtr == NULL) {
if (interp != NULL) {
if (*name == '#') {
- Tcl_AppendResult(interp, "invalid color name \"", name,
- "\"", NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "invalid color name \"%s\"", name));
+ Tcl_SetErrorCode(interp, "TK", "VALUE", "COLOR", NULL);
} else {
- Tcl_AppendResult(interp, "unknown color name \"", name,
- "\"", NULL);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "unknown color name \"%s\"", name));
+ 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])