suit colors

This commit is contained in:
xenofem 2022-07-27 08:53:22 -04:00
parent 4c27ad0aab
commit 847b9ec6d6
2 changed files with 14 additions and 3 deletions

View file

@ -1,7 +1,9 @@
import "cards.asy" as cards;
import "numerals.asy" as numerals;
import "suits.asy" as suits;
for (int suit = 0; suit <= 5; ++suit) {
currentpen = evenodd+suit_colors[suit];
for (int value = 1; value <= 10; ++value) {
currentpicture = new picture;
filldraw(card, white, black);
@ -9,13 +11,13 @@ for (int suit = 0; suit <= 5; ++suit) {
if (suit == CARDS && value == 1) {
// due to exponential growth, with the larger suit icon on the 1
// card, the endpoint of the recursion is a *lot* more visible
fill(recursive_card(value, suit, 6), evenodd+red);
fill(recursive_card(value, suit, 6));
} else if (suit == CARDS && value > 6) {
// conversely, face cards don't need as much recursion depth
// because the only icons present are significantly smaller
fill(recursive_card(value, suit, 3), evenodd+red);
fill(recursive_card(value, suit, 3));
} else {
fill(recursive_card(value, suit), evenodd+red);
fill(recursive_card(value, suit));
}
string suit_str;

View file

@ -19,3 +19,12 @@ icons[CHAIRS] = chair;
icons[BLADES] = blade;
icons[WHEELS] = wheel;
icons[CARDS] = null;
pen suit_colors[] = { defaultpen, defaultpen, defaultpen, defaultpen, defaultpen, defaultpen };
suit_colors[PUPPETS] = black;
suit_colors[CARDS] = black;
suit_colors[BLADES] = red;
suit_colors[BREAD] = red;
suit_colors[CHAIRS] = blue;
suit_colors[WHEELS] = blue;