From 51f8b99e7bc341b8f0b599fd359bd3472789ccb5 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 3 May 2005 08:36:28 +0000 Subject: remove ugly dec2hex --- perl-install/standalone/draksplash | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/perl-install/standalone/draksplash b/perl-install/standalone/draksplash index da027d73a..9310e8c95 100755 --- a/perl-install/standalone/draksplash +++ b/perl-install/standalone/draksplash @@ -418,20 +418,6 @@ sub mk_frame { @buttons); } -#- Desc => take a decimal value between 0 to 255 and return the corresponding hexadecimal value -sub dec2hex { - my ($dec) = @_; - my @dec_hex = (0..9, 'A', 'B', 'C', 'D', 'E', 'F'); - my $int; - my $float; - $dec = $dec/16; - $int = int($dec); - $float = $dec_hex[int(($dec-$int)*16)]; - $int = $dec_hex[$int]; - - return "$int$float"; -} - #- Desc => prepare and set all signal_connect for boot_frame widget sub make_boot_frame() { $boot_conf_frame{frame}->add(mk_frame(\%boot_conf_frame)); @@ -444,8 +430,7 @@ sub make_boot_frame() { $color->cancel_button->signal_connect(clicked => sub { $color->destroy }); $color->ok_button->signal_connect(clicked => sub { my $colour = $color->colorsel->get_current_color; - @rgb = map { dec2hex($_*255) } ($colour->red, $colour->green, $colour->blue); - $theme{boot_conf}{pc} = "0x$rgb[0]$rgb[1]$rgb[2]"; + $theme{boot_conf}{pc} = "0x" . join('', map { print "$_\n"; sprintf("%x", $_*255) } $colour->red, $colour->green, $colour->blue); $color->destroy; }); }); -- cgit v1.2.1