]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
In the config dialog, clip RGB values to [0..255] rather than reducing them
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Tue, 20 Jun 2006 21:10:33 +0000 (21:10 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Tue, 20 Jun 2006 21:10:33 +0000 (21:10 +0000)
mod 256.
Document that the RGB values can be edited, and their range.

[originally from svn r6734]

config.c
doc/config.but

index c844e05942827abece899de9002569f49cc1d2d3..a2f660f4f70b4cf1676031be39f4e07fd8e5e5d9 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 80e7b801229baf37c0b4a8c85f3e384a5949cd53..1de6d43e08de5b426bc90982188c3314634a342b 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