Bump version and update Changes
[convert-color-husl.git] / snapshot-to-csv
CommitLineData
3d128ec5 1#!/usr/bin/perl
b7799d35 2use 5.014000;
4e59696a 3use strict;
3d128ec5
MG
4use warnings;
5
6use File::Slurp;
7use JSON::MaybeXS;
8
9open my $fh, '>', 't/snapshot-rev4.csv';
10select $fh;
11
12my %tests = %{decode_json read_file 't/snapshot-rev4.json'};
13my @colors = qw/xyz luv lch husl huslp/;
14
15say join ',', qw/rgb8 xyz_x xyz_y xyz_z luv_l luv_u luv_v lch_l lch_c lch_h husl_h husl_s husl_l huslp_h husl_s husl_l/;
16for 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}
This page took 0.009627 seconds and 4 git commands to generate.