octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

color "none" for figures


From: Thorsten Meyer
Subject: color "none" for figures
Date: Sat, 06 Feb 2010 21:20:51 +0100
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Hi,

attached is a little patch, which allows a value of "none" for the "color"
property of a figure.
Example:
plot(1,1)
set(gcf, "color", [1 0 0]); # yellow background
set(gcf, "color", "none");  # transparent background

With the gnuplot backend, it allows to set the background of a figure
transparent (this used to be the default before patch 1e38d9ed1e28). Doing this
will also remove the black edge around the plot.

With the fltk backend (and the patch applied), setting the figure color to
"none" does not change the color drawn. However, it doesn't give an error
message either (while a random string does):
lt-octave:1> backend("fltk")
lt-octave:2> plot(2,1)
lt-octave:4> set(gcf, "color", "blue");  # blue background
lt-octave:5> set(gcf, "color", "none").  # background stays blue
lt-octave:6> set(gcf, "color", "blibla")
error: invalid color specification: blibla
error: invalid value for color property "color" (value = blibla)

Can somebody give me a hint, where this fltk problem could be fixed in the 
sources?

Thanks

Thorsten
# HG changeset patch
# User Thorsten Meyer <address@hidden>
# Date 1265485952 -3600

diff -r 9a16a61ed43d src/ChangeLog
--- a/src/ChangeLog     Fri Feb 05 12:09:21 2010 +0100
+++ b/src/ChangeLog     Sat Feb 06 20:52:33 2010 +0100
@@ -0,0 +1,5 @@
+2010-02-06  Thorsten Meyer  <address@hidden>
+
+       * graphics.h.in (base_graphics_object): Allow value "none" for
+       figure color.
+
diff -r 9a16a61ed43d src/graphics.h.in
--- a/src/graphics.h.in Fri Feb 05 12:09:21 2010 +0100
+++ b/src/graphics.h.in Sat Feb 06 20:52:33 2010 +0100
@@ -2563,7 +2563,7 @@
       handle_property currentaxes S , graphics_handle ()
       array_property colormap , jet_colormap ()
       radio_property paperorientation , "{portrait}|landscape|rotated"
-      color_property color , color_values (1, 1, 1)
+      color_property color , color_property (color_values (1, 1, 1), 
radio_values ("none"))
       array_property alphamap , Matrix (64, 1, 1)
       string_property currentcharacter r , ""
       handle_property currentobject r , graphics_handle ()

reply via email to

[Prev in Thread] Current Thread [Next in Thread]