From f1973d263ebc7059989091f2026622ff2766dc66 Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 5 Oct 2019 23:33:36 +0100 Subject: load icons --- icons/gen-load-icons.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 icons/gen-load-icons.sh (limited to 'icons/gen-load-icons.sh') diff --git a/icons/gen-load-icons.sh b/icons/gen-load-icons.sh new file mode 100755 index 0000000..2ff765e --- /dev/null +++ b/icons/gen-load-icons.sh @@ -0,0 +1,36 @@ +#! /usr/bin/env perl + +use warnings; +use strict; + +use local::lib; +use Image::Xpm; +use POSIX; + +my $iwidth = 8; +my $iheight = 16; +my $pixels_per = $iheight / 8; +my $color_bg = "white"; +my $color_fg = "darkseagreen"; + +for ( my $file_num = 0; $file_num <= 8; $file_num++ ) { + my $i = Image::Xpm->new(-file => "load_$file_num.xpm", + -width => $iwidth, + -height => $iheight, + -background => $color_bg); + + my $h = $file_num * $pixels_per; + + for ( my $x = 0; $x < $iwidth; $x++ ) { + for ( my $y = 0; $y < $iheight; $y++ ) { + $i->xy($x, $y, $color_bg); + } + } + for ( my $x = 0; $x < $iwidth; $x++ ) { + for ( my $y = $iheight; $y >= ($iheight - $h); $y-- ) { + $i->xy($x, $y, $color_fg); + } + } + + $i->save; +} -- cgit v1.2.3