Created
May 30, 2012 12:13
-
-
Save gfldex/2835895 to your computer and use it in GitHub Desktop.
huh?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
subset HTMLColor of Str where { * ~~ / '#'<:hexdigit> ** 6 / }; | |
sub alternator (HTMLColor $a is copy, HTMLColor $b is copy){ | |
return sub () { | |
return (($a, $b) = ($b, $a))[0]; | |
} | |
} | |
my $bg_color := alternator('#00aa00', '#00bb00'); | |
say $bg_color() for 1..10; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment