In the config dialog, clip RGB values to [0..255] rather than reducing them
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Tue, 20 Jun 2006 21:10:33 +0000 (21:10 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Tue, 20 Jun 2006 21:10:33 +0000 (21:10 +0000)
mod 256.
Document that the RGB values can be edited, and their range.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6734 cda61777-01e9-0310-a592-d414129be87e

config.c
doc/config.but

index c844e05..a2f660f 100644 (file)
--- a/config.c
+++ b/config.c
@@ -564,7 +564,9 @@ static void colour_handler(union control *ctrl, void *dlg,
            int i, cval;
 
            dlg_editbox_get(ctrl, dlg, buf, lenof(buf));
-           cval = atoi(buf) & 255;
+           cval = atoi(buf);
+           if (cval > 255) cval = 255;
+           if (cval < 0)   cval = 0;
 
            i = dlg_listbox_index(cd->listbox, dlg);
            if (i >= 0) {
index 80e7b80..1de6d43 100644 (file)
@@ -1533,7 +1533,9 @@ use the list box to select which colour you want to modify. The \i{RGB
 values} for that colour will appear on the right-hand side of the
 list box. Now, if you press the \q{Modify} button, you will be
 presented with a colour selector, in which you can choose a new
-colour to go in place of the old one.
+colour to go in place of the old one. (You may also edit the RGB
+values directly in the edit boxes, if you wish; each value is an
+integer from 0 to 255.)
 
 PuTTY allows you to set the \i{cursor colour}, the \i{default foreground}
 and \I{default background}background, and the precise shades of all the