summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-05-03 08:36:28 +0000
committerOlivier Blin <oblin@mandriva.org>2005-05-03 08:36:28 +0000
commit51f8b99e7bc341b8f0b599fd359bd3472789ccb5 (patch)
tree226815d095d624f6cf9a5429123c4f640342a59b /perl-install/standalone
parentceed125b764420edfa4f4a3b6c564874e7b15bdf (diff)
downloaddrakx-51f8b99e7bc341b8f0b599fd359bd3472789ccb5.tar
drakx-51f8b99e7bc341b8f0b599fd359bd3472789ccb5.tar.gz
drakx-51f8b99e7bc341b8f0b599fd359bd3472789ccb5.tar.bz2
drakx-51f8b99e7bc341b8f0b599fd359bd3472789ccb5.tar.xz
drakx-51f8b99e7bc341b8f0b599fd359bd3472789ccb5.zip
remove ugly dec2hex
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/draksplash17
1 files changed, 1 insertions, 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;
});
});