* Bug 15418 fixed: colordef('none'|'black') made title & labels invisible 60/19760/5
Samuel GOUGEON [Tue, 13 Feb 2018 18:37:47 +0000 (19:37 +0100)]
  http://bugzilla.scilab.org/15418

  * page moved intentionally
  * image: md5 unchanged

Change-Id: I9c8238a36e0ae268ccbed1568fe7ce66d645339a

scilab/CHANGES.md
scilab/modules/graphics/help/en_US/figure_operations/colordef.xml [moved from scilab/modules/graphics/help/en_US/color_management/colordef.xml with 92% similarity]
scilab/modules/graphics/macros/colordef.sci
scilab/modules/graphics/tests/nonreg_tests/bug_15418.tst [new file with mode: 0644]
scilab/modules/helptools/images/colordef_1.png

index a2292d4..469bca3 100644 (file)
@@ -548,7 +548,7 @@ Known issues
 * [#15402](http://bugzilla.scilab.org/show_bug.cgi?id=15402): The `range()` page was not fixed against the bug 1904 for the french and portuguese versions.
 * [#15405](http://bugzilla.scilab.org/show_bug.cgi?id=15405): Accessing int64 hdf5 values crashed scilab.
 * [#15413](http://bugzilla.scilab.org/show_bug.cgi?id=15413): Deleting some ranges (rows, columns, pages, ..) in a structures array failed.
-
+* [#15418](http://bugzilla.scilab.org/show_bug.cgi?id=15418): With `colordef('black')` and colordef('none')`, black title and labels were invisible on the black background.
 
 ### Bugs fixed in 6.0.0:
 * [#592](http://bugzilla.scilab.org/show_bug.cgi?id=592): `linspace(a, b, n<=0)` returned `b` instead of `[]`
         </para>
         <para>
             <table border="1">
-                <tr><td>color_scheme</td>  <th>'white'</th>      <th>'black'</th>        <th>'none'</th></tr>
+                <tr><td>Property / L&amp;F</td>  <th>'white'</th>      <th>'black'</th>        <th>'none'</th></tr>
                 <tr><td>fig.color_map</td> <td>jetcolormap(64)</td><td>jetcolormap(64)</td><td>hsvcolormap(64)</td></tr>
                 <tr><td>fig.background</td><td>light gray</td>   <td>dark gray</td>      <td>dark gray</td></tr>
                 <tr><td>axes.background</td><td>white</td>       <td>black</td>          <td>black</td></tr>
                 <tr><td>axes.foreground</td><td>black</td>       <td>white</td>          <td>white</td></tr>
+                <tr><td>(labels).font_foreground</td><td>black</td><td>white</td>        <td>white</td></tr>
             </table>
         </para>
         <para>
                     "default" color_scheme introduced.
                 </revdescription>
             </revision>
+            <revision>
+                <revnumber>6.0.2</revnumber>
+                <revdescription>
+                    With "black" and "none" color shemes, titles and axes labels are now drawn in white.
+                </revdescription>
+            </revision>
         </revhistory>
     </refsection>
 </refentry>
index 98fdd39..106bfb3 100644 (file)
@@ -72,6 +72,10 @@ function colordef(varargin)
         a.foreground = -1;
         a.font_color = a.foreground;
         a.mark_foreground = a.foreground;
+        a.title.font_foreground = -1;
+        a.x_label.font_foreground = -1;
+        a.y_label.font_foreground = -1;
+        a.z_label.font_foreground = -1;
 
     case "black"
         if getos() == "Windows" then
@@ -85,6 +89,10 @@ function colordef(varargin)
         a.foreground = -2;
         a.font_color = a.foreground;
         a.mark_foreground = a.foreground;
+        a.title.font_foreground = -2;
+        a.x_label.font_foreground = -2;
+        a.y_label.font_foreground = -2;
+        a.z_label.font_foreground = -2;
 
     case "none"
         f.color_map  = [hsvcolormap(64)];
@@ -93,6 +101,10 @@ function colordef(varargin)
         a.foreground = -2;
         a.font_color = a.foreground;
         a.mark_foreground = a.foreground;
+        a.title.font_foreground = -2;
+        a.x_label.font_foreground = -2;
+        a.y_label.font_foreground = -2;
+        a.z_label.font_foreground = -2;
     else
         msg = gettext("%s: Wrong value for input argument #%d: Must be in the set {%s}.\n");
         error(msprintf(msg, "colordef", size(varargin),"""default"", ""white"", ""black"", ""none"""));
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_15418.tst b/scilab/modules/graphics/tests/nonreg_tests/bug_15418.tst
new file mode 100644 (file)
index 0000000..18ec3f1
--- /dev/null
@@ -0,0 +1,50 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2018 - Samuel GOUGEON
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH GRAPHIC -->
+// <-- INTERACTIVE TEST -->
+
+// <-- Non-regression test for bug 15418 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/15418
+//
+// <-- Short Description -->
+// With colordef("black") and colordef("none"), titles and axes labels were
+//  invisible or almost invisible.
+
+colordef("none")
+xdel(winsid())
+scf(1);
+param3d(), xtitle("General title","X title","Y title", "Z title")
+scf(2);
+plot(), xtitle("General title","X title","Y title")
+// Check that titles are well visible in white
+
+colordef("black")
+xdel(winsid())
+scf(1);
+param3d(), xtitle("General title","X title","Y title", "Z title")
+scf(2);
+plot(), xtitle("General title","X title","Y title")
+// Check that titles are well visible in white
+
+colordef("white")
+xdel(winsid())
+scf(1);
+param3d(), xtitle("General title","X title","Y title", "Z title")
+scf(2);
+plot(), xtitle("General title","X title","Y title")
+// Check that titles are well visible in black on grey (unchanged)
+
+colordef("default")
+xdel(winsid())
+scf(1);
+param3d(), xtitle("General title","X title","Y title", "Z title")
+scf(2);
+plot(), xtitle("General title","X title","Y title")
+// Check that titles are well visible in black on white (unchanged)
index 7430a6a..27bc83b 100644 (file)
Binary files a/scilab/modules/helptools/images/colordef_1.png and b/scilab/modules/helptools/images/colordef_1.png differ