aboutsummaryrefslogtreecommitdiff
path: root/Perl/demos/Tk
diff options
context:
space:
mode:
authormertz2003-06-18 13:28:03 +0000
committermertz2003-06-18 13:28:03 +0000
commitc30424db45ba7bc0ff4a3bccbaae0ae0b02d289f (patch)
tree95e2832a5e9b9b383fa8a3337624d103f80c4e8b /Perl/demos/Tk
parenta52b3b3334b2b1eabb60c399311f5d77f98cb79f (diff)
downloadtkzinc-c30424db45ba7bc0ff4a3bccbaae0ae0b02d289f.zip
tkzinc-c30424db45ba7bc0ff4a3bccbaae0ae0b02d289f.tar.gz
tkzinc-c30424db45ba7bc0ff4a3bccbaae0ae0b02d289f.tar.bz2
tkzinc-c30424db45ba7bc0ff4a3bccbaae0ae0b02d289f.tar.xz
adding parameters to the axial gradient to limit the span of the gradient
Diffstat (limited to 'Perl/demos/Tk')
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/color-x.pl26
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/color-y.pl29
2 files changed, 48 insertions, 7 deletions
diff --git a/Perl/demos/Tk/demos/zinc_lib/color-x.pl b/Perl/demos/Tk/demos/zinc_lib/color-x.pl
index 679f19e..d576102 100644
--- a/Perl/demos/Tk/demos/zinc_lib/color-x.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/color-x.pl
@@ -15,16 +15,26 @@ my $zinc = $mw->Zinc(-width => 700, -height => 600,
die "no openGL rendering on this X server" unless $zinc->cget(-render);
-$zinc->add('rectangle', 1, [10,10, 690, 100], -fillcolor => "red | blue", -filled => 1);
+
+$zinc->add('rectangle', 1, [10,10, 690, 50], -fillcolor => "=axial 0 | red | blue", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
- -text => "A variation from non transparent red to non transparent blue.\n",
+ -text => "A variation from non transparent red to non transparent blue.",
-anchor => 'nw',
-position => [20, 20]);
-$zinc->add('rectangle', 1, [10,110, 690, 200], -fillcolor => "=axial 0 |red;40|blue;40", -filled => 1);
+$zinc->add('rectangle', 1, [10,60, 690, 100], -fillcolor => "=axial -30 0 30 0 | red | blue", -filled => 1);
+
+$zinc->add('text', 1,
+ -font => $defaultfont,
+ -text => "The same with a reduced span.",
+ -anchor => 'nw',
+ -position => [20, 70]);
+
+
+$zinc->add('rectangle', 1, [10,110, 690, 150], -fillcolor => "=axial 0 |red;40|blue;40", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
@@ -32,6 +42,16 @@ $zinc->add('text', 1,
-anchor => 'nw',
-position => [20, 120]);
+
+$zinc->add('rectangle', 1, [10,160, 690, 200], -fillcolor => "=axial -30 0 30 0 |red;40|blue;40", -filled => 1);
+
+$zinc->add('text', 1,
+ -font => $defaultfont,
+ -text => "The same with a reduced span.",
+ -anchor => 'nw',
+ -position => [20, 170]);
+
+
# we are using here the X explicit notation for rgb color
# we could also have used CIE encoding. If interested,
# please read the X man pages
diff --git a/Perl/demos/Tk/demos/zinc_lib/color-y.pl b/Perl/demos/Tk/demos/zinc_lib/color-y.pl
index b119d0a..c450c72 100644
--- a/Perl/demos/Tk/demos/zinc_lib/color-y.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/color-y.pl
@@ -17,23 +17,43 @@ my $zinc = $mw->Zinc(-width => 700, -height => 600,
die "no openGL rendering on this X server" unless $zinc->cget(-render);
-$zinc->add('rectangle', 1, [10, 10, 690, 100], -fillcolor => "=axial 90 |red |blue", -filled => 1);
+$zinc->add('rectangle', 1, [10, 10, 340, 100], -fillcolor => "=axial 90 |red |blue", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
- -text => "A variation from non transparent red to non transparent blue.\n",
+ -text => "A variation from non transparent red\n to non transparent blue.",
-anchor => 'nw',
-position => [20, 20]);
-$zinc->add('rectangle', 1, [10,110, 690, 200], -fillcolor => "=axial 90|red;40 |blue;40", -filled => 1);
+$zinc->add('rectangle', 1, [360, 10, 690, 100], -fillcolor => "=axial 0 30 0 -30 |red |blue", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
- -text => "A variation from 40%transparent red to 40% transparent blue.",
+ -text => "The same with a reduced span.",
+ -anchor => 'nw',
+ -position => [370, 20]);
+
+
+
+$zinc->add('rectangle', 1, [10,110, 330, 200], -fillcolor => "=axial 90|red;40 |blue;40", -filled => 1);
+
+$zinc->add('text', 1,
+ -font => $defaultfont,
+ -text => "A variation from 40%transparent red\nto 40% transparent blue.",
-anchor => 'nw',
-position => [20, 120]);
+
+$zinc->add('rectangle', 1, [360,110, 690, 200], -fillcolor => "=axial 0 30 0 -30|red;40 |blue;40", -filled => 1);
+
+$zinc->add('text', 1,
+ -font => $defaultfont,
+ -text => "The same with a reduced span.",
+ -anchor => 'nw',
+ -position => [370, 120]);
+
+
$zinc->add('rectangle', 1, [10, 210, 690, 300], -fillcolor => "=axial 90 |red;40|green;40 50|blue;40", -filled => 1);
$zinc->add('text', 1,
@@ -43,6 +63,7 @@ $zinc->add('text', 1,
-anchor => 'nw',
-position => [20, 220]);
+
$zinc->add('text', 1,
-font => $defaultfont,
-text => "Two overlaping transparently colored rectangles on a white background",