text := filter_text(match: card_name+"(</[-a-z]+>)? is (colorless|all colors|((blue|white|green|red|black)((,|,? and) (blue|white|green|red|black))*))\\.")
if text == "" then ""
else if contains(text, match: "all colors") then (
colors := "WUBRG"
if land = "land" then land_multicolor()
else mana_to_color(hybrid: "")
) else (
colors := ""
if contains(text, match: "white") then colors := colors + "W"
if contains(text, match: "blue") then colors := colors + "U"
if contains(text, match: "black") then colors := colors + "B"
if contains(text, match: "red") then colors := colors + "R"
if contains(text, match: "green") then colors := colors + "G"
if land = "land" then land_multicolor()
else mana_to_color(hybrid: "")
)
}
# The color of a card
is_artifact := match_rule(match: "(?i)Artifact")
is_land := match_rule(match: "(?i)Land")
card_color := {
# usually the color of mana
mana_color := mana_to_color(casting_cost);
if mana_color == "colorless" and is_land (card.super_type) then land_to_color()
else if mana_color == "colorless" and is_artifact(card.super_type) then "artifact"