I'm using perl mod Gnome::ZvtTerm and want to change the defualt color
using $term->set_color_scheme($red, $green, $blue); The problem is no
matter how I plug-in the data I get this :\
need an array ref in set_color_scheme at zterm.pl line 518.
Can someone please show me a simple example to set the bg = black and
fg = white
Thanks,
-Russell |
Request for Question Clarification by
studboy-ga
on
23 Jul 2002 15:19 PDT
Hi Russ
Can you tell me how you plugged in the numbers?
Let me know if this works--thanks:
$red = [0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa,
0x0000, 0xaaaa, 0x5555, 0xffff, 0x5555, 0xffff,
0x5555, 0xffff, 0x5555, 0xffff, 0xaaaa, 0x0];
$green = [0x0000, 0x0000, 0xaaaa, 0x5555, 0x0000, 0x0000,
0xaaaa, 0xaaaa, 0x5555, 0x5555, 0xffff, 0xffff,
0x5555, 0x5555, 0xffff, 0xffff, 0xaaaa, 0x0];
$blue = [0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa,
0xaaaa, 0xaaaa, 0x5555, 0x5555, 0x5555, 0x5555,
0xffff, 0xffff, 0xffff, 0xffff, 0xaaaa, 0x0];
$term->set_color_scheme($red, $green, $blue);
|
Clarification of Question by
russ_man-ga
on
24 Jul 2002 08:29 PDT
Yes, that worked for me! Now I have some kind of realize() problem to
work out but I'm closer then ever before.
|
Clarification of Question by
russ_man-ga
on
24 Jul 2002 09:21 PDT
I don't mean to wast your time but could you please explain how this
sets the foreground = white and background = black. The reason is I
want the user to pick a color using the Gtk::ColorSelectionDialog and
I'm not sure how to do this yet.
Thanks for your time.
Russ
|
Request for Question Clarification by
studboy-ga
on
24 Jul 2002 09:51 PDT
Hi Russ
I will type up a formal answer for you by the end of the day.
Basically the (hex value) array in $red, $green, $blue form 3-tuples--
if you read it in this order:
($red[0], $green[0], $blue[0])
($red[1], $green[1], $blue[1])
...
you will get
(0, 0, 0),
(43690, 0, 0),
(0, 43690, 0),
(43690, 21845, 0),
(0, 0, 43690),
(43690, 0, 43690),
(0, 43690, 43690),
(43690, 43690, 43690),
(21845, 21845, 21845),
(65535, 21845, 21845),
(21845, 65535, 21845),
(65535, 65535, 21845),
(21845, 21845, 65535),
(65535, 21845, 65535),
(21845, 65535, 65535),
(65535, 65535, 65535),
(43690, 43690, 43690),
(0, 0, 0)
Each of the 3-tuples specify a color component as defined
in gnome-terminal.c
|