From 32943999c79b01bc57febcd762d377afdfdb2a93 Mon Sep 17 00:00:00 2001 From: Aaron Suen Date: Tue, 17 Dec 2019 19:32:18 -0500 Subject: [PATCH] Add script for generating monochrome texture pack for testing. --- docs/ncmono.pl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 docs/ncmono.pl diff --git a/docs/ncmono.pl b/docs/ncmono.pl new file mode 100644 index 00000000..c4e6c600 --- /dev/null +++ b/docs/ncmono.pl @@ -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"; + } + }, + "..");