Commit | Line | Data |
---|---|---|
3d128ec5 | 1 | #!/usr/bin/perl |
b7799d35 | 2 | use 5.014000; |
4e59696a | 3 | use strict; |
3d128ec5 MG |
4 | use warnings; |
5 | ||
6 | use File::Slurp; | |
7 | use JSON::MaybeXS; | |
8 | ||
9 | open my $fh, '>', 't/snapshot-rev4.csv'; | |
10 | select $fh; | |
11 | ||
12 | my %tests = %{decode_json read_file 't/snapshot-rev4.json'}; | |
d192eff4 | 13 | my @colors = qw/xyz luv lch hsluv hpluv/; |
3d128ec5 | 14 | |
d192eff4 | 15 | say join ',', qw/rgb8 xyz_x xyz_y xyz_z luv_l luv_u luv_v lch_l lch_c lch_h hsluv_h hsluv_s hsluv_l hpluv_h hsluv_s hsluv_l/; |
3d128ec5 | 16 | for my $rgb8 (sort keys %tests) { |
b7799d35 | 17 | next if $rgb8 =~ m/[13579bde]/i; |
3d128ec5 MG |
18 | my @cols = map { @{$tests{$rgb8}{$_}} } @colors; |
19 | say join ',', substr($rgb8, 1), map { sprintf '%.4f', $_ } @cols; | |
20 | } |