./test/package/mingw-ncurses-examples.spec
./test/package/ncurses-examples.spec
./test/padview.c
+./test/parse_rgb.h
./test/picsmap.c
./test/picsmap.h
./test/popup_msg.c
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3071 2018/01/30 00:35:11 tom Exp $
+-- $Id: NEWS,v 1.3076 2018/02/04 01:14:28 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20180203
+ + minor fixes to test/*.h to make them idempotent.
+ + add/use test/parse_rgb.h to show how the "RGB" capability works.
+ + add a clarification in user_caps.5 regarding "RGB" capability.
+ + add extended_slk_color{,_sp} symbols to the appropriate
+ package/*.{map,sym} files (report by Sven Joachim, cf: 20170401).
+
20180129
+ update "VERSION" file, used in shared-library naming.
-5:0:10 6.1 20180129
+5:0:10 6.1 20180203
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.1208 2018/01/30 00:32:36 tom Exp $
+# $Id: dist.mk,v 1.1209 2018/01/31 20:55:08 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 6
NCURSES_MINOR = 1
-NCURSES_PATCH = 20180129
+NCURSES_PATCH = 20180203
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "form_" for detailed
descriptions of the entry points.
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
https://invisible-island.net/ncurses/tctest.html
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "menu_" for detailed
descriptions of the entry points.
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
method of updating character screens with reasonable optimization.
This implementation is "new curses" (ncurses) and is the approved
replacement for 4.4BSD classic curses, which has been discontinued.
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
The <STRONG>ncurses</STRONG> library emulates the curses library of System V Release 4
UNIX, and XPG4 (X/Open Portability Guide) curses (also known as XSI
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
<EM>Terminfo</EM> describes terminals by giving a set of capabilities which they
have, by specifying how to perform screen operations, and by specifying
padding requirements and initialization sequences. This describes
- <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
</PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
<STRONG><A HREF="term.5.html">term(5)</A></STRONG>. <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
<STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG>ter-</STRONG>
<STRONG><A HREF="terminfo.5.html">minfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>, <STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
<STRONG>csh(1)</STRONG>, <STRONG>sh(1)</STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>, <STRONG>tty(4)</STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>,
<STRONG>ttys(5)</STRONG>, <STRONG>environ(7)</STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180127).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20180203).
<!--
****************************************************************************
- * Copyright (c) 2017 Free Software Foundation, Inc. *
+ * Copyright (c) 2017,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: user_caps.5,v 1.4 2017/11/25 20:13:12 tom Exp @
+ * @Id: user_caps.5,v 1.6 2018/02/03 22:38:17 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
explicitly list the number of bits used for red, green and
blue components as a slash-separated list of decimal integers.
+ Because there are several RGB encodings in use, applications
+ which make assumptions about the number of bits per color are
+ unlikely to work reliably. As a trivial case, for example, one
+ could define <STRONG>RGB#1</STRONG> to represent the standard eight ANSI colors,
+ i.e., one bit per color.
+
U8 <EM>boolean</EM>, asserts that ncurses must use Unicode values for line-
drawing characters, and that it should ignore the alternate char-
acter set capabilities when the locale uses UTF-8 encoding. For
----------------------------------
2 Shift
3 Alt
+
4 Shift + Alt
5 Control
6 Shift + Control
7 Alt + Control
8 Shift + Alt + Control
9 Meta
-
10 Meta + Shift
11 Meta + Alt
12 Meta + Alt + Shift
.\"***************************************************************************
-.\" Copyright (c) 2017 Free Software Foundation, Inc. *
+.\" Copyright (c) 2017,2018 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: user_caps.5,v 1.4 2017/11/25 20:13:12 tom Exp $
+.\" $Id: user_caps.5,v 1.6 2018/02/03 22:38:17 tom Exp $
.TH user_caps 5
.ie \n(.g .ds `` \(lq
.el .ds `` ``
explicitly list the number of bits used for red, green and blue components
as a slash-separated list of decimal integers.
.RE
+.IP
+Because there are several RGB encodings in use,
+applications which make assumptions about the number of bits per color
+are unlikely to work reliably.
+As a trivial case, for example, one could define \fBRGB#1\fP
+to represent the standard eight ANSI colors, i.e., one bit per color.
.TP 3
U8
\fIboolean\fP,
-ncurses6 (6.1+20180129) unstable; urgency=low
+ncurses6 (6.1+20180203) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 29 Jan 2018 19:32:37 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Wed, 31 Jan 2018 15:55:08 -0500
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.1+20180129) unstable; urgency=low
+ncurses6 (6.1+20180203) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 29 Jan 2018 19:32:37 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Wed, 31 Jan 2018 15:55:08 -0500
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.1+20180129) unstable; urgency=low
+ncurses6 (6.1+20180203) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 29 Jan 2018 19:32:37 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Wed, 31 Jan 2018 15:55:08 -0500
ncurses6 (5.9-20120608) unstable; urgency=low
-; $Id: mingw-ncurses.nsi,v 1.255 2018/01/30 00:32:37 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.256 2018/01/31 20:55:08 tom Exp $\r
\r
; TODO add examples\r
; TODO bump ABI to 6\r
!define VERSION_MAJOR "6"\r
!define VERSION_MINOR "1"\r
!define VERSION_YYYY "2018"\r
-!define VERSION_MMDD "0129"\r
+!define VERSION_MMDD "0203"\r
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
\r
!define MY_ABI "5"\r
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 6.1
-Release: 20180129
+Release: 20180203
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.1
-Release: 20180129
+Release: 20180203
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
-# $Id: ncursestw.map,v 1.42 2017/12/30 20:51:38 tom Exp $
+# $Id: ncursestw.map,v 1.43 2018/01/31 23:58:06 tom Exp $
# script for shared library symbol-versioning using ld
#
# This file was generated by ncu-mapsyms
extended_color_content_sp;
extended_pair_content;
extended_pair_content_sp;
+ extended_slk_color;
+ extended_slk_color_sp;
find_pair;
find_pair_sp;
free_pair;
-# $Id: ncursestw.sym,v 1.32 2017/08/11 17:33:23 tom Exp $
+# $Id: ncursestw.sym,v 1.33 2018/01/31 23:58:56 tom Exp $
# script for shared library symbol-visibility using libtool
#
# This file was generated by ncu-mapsyms
extended_color_content_sp
extended_pair_content
extended_pair_content_sp
+extended_slk_color
+extended_slk_color_sp
field_arg
field_back
field_buffer
-# $Id: ncursesw.map,v 1.46 2017/12/30 20:51:38 tom Exp $
+# $Id: ncursesw.map,v 1.47 2018/01/31 23:58:25 tom Exp $
# script for shared library symbol-versioning using ld
#
# This file was generated by ncu-mapsyms
extended_color_content_sp;
extended_pair_content;
extended_pair_content_sp;
+ extended_slk_color;
+ extended_slk_color_sp;
find_pair;
find_pair_sp;
free_pair;
-# $Id: ncursesw.sym,v 1.32 2017/08/12 21:34:38 tom Exp $
+# $Id: ncursesw.sym,v 1.33 2018/01/31 23:58:44 tom Exp $
# script for shared library symbol-visibility using libtool
#
# This file was generated by ncu-mapsyms
extended_color_content_sp
extended_pair_content
extended_pair_content_sp
+extended_slk_color
+extended_slk_color_sp
field_arg
field_back
field_buffer
/****************************************************************************
- * Copyright (c) 2009-2010,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 2009-2012,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* authorization. *
****************************************************************************/
+/*
+ * $Id: linedata.h,v 1.7 2018/02/03 22:51:43 tom Exp $
+ *
+ * Utility functions for reading a line of text from a file.
+ */
+#ifndef LINEDATA_H_incl
+#define LINEDATA_H_incl 1
+
+#include <test.priv.h>
+
#define isQUIT(c) ((c) == QUIT || (c) == ESCAPE)
#define key_RECUR CTRL('W')
}
return result;
}
+
+#endif /* LINEDATA_H_incl */
-# $Id: modules,v 1.66 2017/10/22 16:06:33 tom Exp $
+# $Id: modules,v 1.67 2018/02/03 23:45:16 tom Exp $
##############################################################################
-# Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. #
+# Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
railroad progs $(srcdir) $(HEADER_DEPS)
rain progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
redraw progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
-savescreen progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
+savescreen progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h $(srcdir)/parse_rgb.h
sp_tinfo progs $(srcdir) $(HEADER_DEPS)
tclock progs $(srcdir) $(HEADER_DEPS)
test_add_wchstr progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h
--- /dev/null
+/****************************************************************************
+ * Copyright (c) 2018 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+/*
+ * $Id: parse_rgb.h,v 1.4 2018/02/03 23:40:53 tom Exp $
+ *
+ * Sample implementation of ncurses RGB extension from user_caps(5).
+ */
+#ifndef PARSE_RBG_H_incl
+#define PARSE_RBG_H_incl 1
+
+#include <test.priv.h>
+
+#if HAVE_TIGETSTR && USE_WIDEC_SUPPORT
+static int
+parse_rgb(int *r_max, int *g_max, int *b_max)
+{
+ int colors = tigetnum("colors");
+ int result = ERR;
+
+ *r_max = *g_max = *b_max = 0;
+
+ if (colors > 0) {
+ int max_bits;
+ int bits;
+ int pwr2;
+ int r = 0, g = 0, b = 0;
+ char *data;
+ char ch;
+
+ for (max_bits = 0, pwr2 = 1;
+ pwr2 < colors;
+ ++max_bits, pwr2 <<= 1) {
+ ;
+ }
+
+ if (tigetflag("RGB") > 0) {
+ result = OK;
+ r = g = b = (max_bits + 2) / 3;
+ } else if ((bits = tigetnum("RGB")) > 0) {
+ result = OK;
+ r = g = b = bits;
+ } else if ((data = tigetstr("RGB")) != ABSENT_STRING
+ && data != CANCELLED_STRING
+ && sscanf(data, "%d/%d/%d%c", &r, &g, &b, &ch) == 3) {
+ result = OK;
+ }
+
+ if ((r + g + b) < max_bits) {
+ result = ERR;
+ } else if (result == 0) {
+ if (r > max_bits) {
+ r = max_bits;
+ g = b = 0;
+ }
+ *r_max = r;
+ if (g > (max_bits -= r)) {
+ g = max_bits;
+ b = 0;
+ }
+ *g_max = g;
+ if (b > (max_bits -= g)) {
+ b = max_bits;
+ }
+ *b_max = b;
+ }
+ }
+ return result;
+}
+#else
+#define parse_rgb(r,g,b) (ERR)
+#endif
+
+#endif /* PARSE_RBG_H_incl */
/****************************************************************************
- * Copyright (c) 2003-2013,2017 Free Software Foundation, Inc. *
+ * Copyright (c) 2003-2017,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* authorization. *
****************************************************************************/
/*
- * $Id: popup_msg.h,v 1.3 2017/04/15 19:16:35 tom Exp $
+ * $Id: popup_msg.h,v 1.4 2018/02/03 21:07:55 tom Exp $
*
- * Interface of edit_field.c
+ * Utility functions for a popup-message or help-screen.
*/
#ifndef POPUP_MSG_H_incl
* authorization. *
****************************************************************************/
/*
- * $Id: savescreen.c,v 1.51 2018/01/14 17:39:47 tom Exp $
+ * $Id: savescreen.c,v 1.52 2018/02/03 23:18:50 tom Exp $
*
* Demonstrate save/restore functions from the curses library.
* Thomas Dickey - 2007/7/14
#include <test.priv.h>
#include <popup_msg.h>
+#include <parse_rgb.h>
#if HAVE_SCR_DUMP
init_pair((short) (n + MAX_ANSI), (short) n, (short) n);
}
#if HAVE_TIGETSTR && USE_WIDEC_SUPPORT
- else if (tigetflag("RGB") > 0) {
- int rows = LINES - 1;
- int cols = COLS - 1;
- /* FIXME: test all 3 types of capability */
- int b_max = 255;
- int r_max = 255;
- int g_max = 255;
- int b_delta = (b_max / rows);
- int r_delta = (r_max / cols);
- int g_delta = (g_max / cols);
- int row = 0;
-
- b = 0;
- using_rgb = TRUE;
- while (row++ < rows) {
- int col = 0;
- r = 0;
- g = g_max;
- while (col++ < cols) {
- int color = (((r * (g_max + 1)) + g) * (b_max + 1)
- + b + MAX_ANSI);
+ else {
+ int r_max, g_max, b_max;
+
+ if (parse_rgb(&r_max, &g_max, &b_max) > 0) {
+ int rows = LINES - 1;
+ int cols = COLS - 1;
+ int b_delta = (b_max / rows);
+ int r_delta = (r_max / cols);
+ int g_delta = (g_max / cols);
+ int row = 0;
+
+ b = 0;
+ using_rgb = TRUE;
+ while (row++ < rows) {
+ int col = 0;
+ r = 0;
+ g = g_max;
+ while (col++ < cols) {
+ int color = (((r * (g_max + 1)) + g) * (b_max + 1)
+ + b + MAX_ANSI);
#if HAVE_INIT_EXTENDED_COLOR
- init_extended_pair(pair, color, color);
+ init_extended_pair(pair, color, color);
#else
- init_pair(pair, color, color);
+ init_pair(pair, color, color);
#endif
- pair++;
- r += r_delta;
- g -= g_delta;
+ pair++;
+ r += r_delta;
+ g -= g_delta;
+ }
+ b += b_delta;
}
- b += b_delta;
}
}
#endif