Add script for generating monochrome texture pack for testing.
This commit is contained in:
parent
b36b4e69eb
commit
32943999c7
26
docs/ncmono.pl
Normal file
26
docs/ncmono.pl
Normal file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/perl -w
|
||||
# ----------------------------------------------------------------------
|
||||
# Create/update a (nearly) monochrome texture pack for NodeCore, for
|
||||
# testing the game's accessibility for colorblind users. All things
|
||||
# should be visually distinguishable using luma hints alone, without
|
||||
# relying on chroma channels.
|
||||
# ----------------------------------------------------------------------
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Find qw(find);
|
||||
use File::Path qw(mkpath);
|
||||
|
||||
my $outd = "$ENV{HOME}/.minetest/textures/ncmono";
|
||||
|
||||
-d $outd or mkpath($outd);
|
||||
-d $outd or die("failed to mkpath $outd");
|
||||
|
||||
find(
|
||||
{ wanted => sub {
|
||||
-f $_ and -s $_ and $_ =~ m#\.png$# or return;
|
||||
my $r = system("convert", $_, qw(-colorspace gray), "$outd/$_");
|
||||
$r and die("convert $_ returned $r");
|
||||
print "$_\n";
|
||||
}
|
||||
},
|
||||
"..");
|
Loading…
x
Reference in New Issue
Block a user