Colour bars/Display: Difference between revisions
Rename Perl 6 -> Raku, alphabetize, minor clean-up
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
|||
Line 793:
End</lang>
=={{header|Go}}==
{{libheader|Go Graphics}}
Line 1,117 ⟶ 1,118:
Checkit
</lang>
=={{header|Maple}}==
Line 1,181:
print DISPLAY $image->png ;
close DISPLAY ;#to be watched with <image viewer> testprogram.png</lang>
=={{header|Perl 6}}==▼
{{works with|Rakudo|2018.10}}▼
<lang perl6>my ($x,$y) = 1280, 720;▼
my @colors = map -> $r, $g, $b { Buf.new: |(($r, $g, $b) xx $x div 8) },▼
0, 0, 0,▼
255, 0, 0,▼
0, 255, 0,▼
0, 0, 255,▼
255, 0, 255,▼
0, 255, 255,▼
255, 255, 0,▼
255, 255, 255;▼
my $img = open "colorbars.ppm", :w orelse die "Can't create colorbars.ppm: $_";▼
$img.print: qq:to/EOH/;▼
P6▼
# colorbars.ppm▼
$x $y▼
255▼
EOH▼
for ^$y {▼
for ^@colors -> $h {▼
$img.write: @colors[$h];▼
}▼
}▼
$img.close;</lang>▼
=={{header|Phix}}==
Line 1,421 ⟶ 1,391:
(void (new full-frame%))
</lang>
(formerly Perl 6)
▲{{works with|Rakudo|2018.10}}
▲<lang perl6>my ($x,$y) = 1280, 720;
▲my @colors = map -> $r, $g, $b { Buf.new: |(($r, $g, $b) xx $x div 8) },
▲ 0, 0, 0,
▲ 255, 0, 0,
▲ 0, 255, 0,
▲ 0, 0, 255,
▲ 255, 0, 255,
▲ 0, 255, 255,
▲ 255, 255, 0,
▲ 255, 255, 255;
▲my $img = open "colorbars.ppm", :w orelse die "Can't create colorbars.ppm: $_";
▲$img.print: qq:to/EOH/;
▲ P6
▲ # colorbars.ppm
▲ $x $y
▲ 255
▲ EOH
▲for ^$y {
▲ for ^@colors -> $h {
▲ $img.write: @colors[$h];
▲ }
▲}
▲$img.close;</lang>
=={{header|REXX}}==
|