summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-08-04 06:20:21 +0000
committerOlivier Blin <oblin@mandriva.org>2005-08-04 06:20:21 +0000
commitcc80bc093264e0a3fb982229565193faddcd39df (patch)
treee03295860c4536f64c7cfb7c98ae601515bae0a8 /perl-install/standalone
parentc61aba8530f966055caef64322fa1ee5e1591c5a (diff)
downloaddrakx-cc80bc093264e0a3fb982229565193faddcd39df.tar
drakx-cc80bc093264e0a3fb982229565193faddcd39df.tar.gz
drakx-cc80bc093264e0a3fb982229565193faddcd39df.tar.bz2
drakx-cc80bc093264e0a3fb982229565193faddcd39df.tar.xz
drakx-cc80bc093264e0a3fb982229565193faddcd39df.zip
make sure hex colors are 6 chars long
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/draksplash4
1 files changed, 2 insertions, 2 deletions
diff --git a/perl-install/standalone/draksplash b/perl-install/standalone/draksplash
index a84756e7c..558f6bfd1 100755
--- a/perl-install/standalone/draksplash
+++ b/perl-install/standalone/draksplash
@@ -173,12 +173,12 @@ sub choose_image {
sub choose_color() {
my $color = gtkshow(Gtk2::ColorSelectionDialog->new(N("ProgressBar color selection")));
- my @rgb = $theme{conf}{pc} =~ m/#(.{2})(.{2})(.{2})/ && map { hex($_)/255 } ($1, $2, $3);
+ my @rgb = $theme{conf}{pc} =~ /^#(.{2})(.{2})(.{2})$/ ? (map { hex($_)*255 } ($1, $2, $3)) : ();
$color->colorsel->set_current_color(gtkcolor(@rgb));
$color->cancel_button->signal_connect(clicked => sub { $color->destroy });
$color->ok_button->signal_connect(clicked => sub {
my $colour = $color->colorsel->get_current_color;
- $theme{conf}{pc} = "#" . join('', map { sprintf("%x", $_/255) } $colour->red, $colour->green, $colour->blue);
+ $theme{conf}{pc} = "#" . join('', map { sprintf("%02x", $_/255) } $colour->red, $colour->green, $colour->blue);
$color->destroy;
});
}