File: makehuesteps

package info (click to toggle)
circos 0.69.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 65,120 kB
  • sloc: perl: 15,905; sh: 57; makefile: 9
file content (21 lines) | stat: -rwxr-xr-x 519 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env perl 

use strict;
use Math::Round qw(round);

# in steps
for my $steps (1..360) {
    next unless 360/$steps == int(360/$steps);
    my @hue = map { sprintf("%03d", 360/$steps*($_-1)) } (1..$steps);
    printf("hue-s%d = hue(%s)\n",360/$steps,join("|",@hue));
}

# in divisions

for my $divisions (3..30) {
    my @hue;
    for my $step ( 0 .. $divisions-1 ) {
	push @hue, 360 * $step / $divisions;
    }   
    printf("hue-%d = hue(%s)\n",$divisions,join("|",map { sprintf("%03d",round $_) } @hue));
}