Debian Codegraph @

etc/makehuesteps

raw ◀ ▶
1 Debian patch touch this file
•1 #!/usr/bin/env perl
2
3 use strict;
4 use Math::Round qw(round);
5
6 # in steps
7 for my $steps (1..360) {
8 next unless 360/$steps == int(360/$steps);
9 my @hue = map { sprintf("%03d", 360/$steps*($_-1)) } (1..$steps);
10 printf("hue-s%d = hue(%s)\n",360/$steps,join("|",@hue));
11 }
12
13 # in divisions
14
15 for my $divisions (3..30) {
16 my @hue;
17 for my $step ( 0 .. $divisions-1 ) {
18 push @hue, 360 * $step / $divisions;
19 }
20 printf("hue-%d = hue(%s)\n",$divisions,join("|",map { sprintf("%03d",round $_) } @hue));
21 }