# Path: cogs/utils/imagetools.py
# class Color():
# 	def __init__(self, value):
# 		if isinstance(value, Color):
# 			value = value.hex
# 		if isinstance(value, str):
# 			if not re.match(r"#?[0-9a-fA-F]{6}$", value):
# 				raise ValueError("Color given invalid hex color")
# 			value = value.lstrip("#")
# 			lv = len(value)
# 			self.r, self.g, self.b = tuple(int(value[i:i + lv // 3], 16) for i in range(0, lv, lv // 3))
# 		elif isinstance(value, tuple):
# 			if len(value) == 3:
# 				self.r, self.g, self.b = value
# 			elif len(value) == 4: # throw away alpha here
# 				self.r, self.g, self.b, a = value
# 			else:
# 				raise ValueError("Wrong number of values in tuple")
# 		else:
# 			raise ValueError("Unexpected type given to Color constructor")
# 
# 	@property
# 	def integer(self):
# 		return int(self.hex[1:], 16)
# 
# 	@property
# 	def hex(self):
# 		return "#{0:02x}{1:02x}{2:02x}".format(self.r, self.g, self.b)
# 
# 	@property
# 	def rgb_tuple(self):
# 		return (self.r, self.g, self.b)
# 
# 	@property
# 	def hsv_tuple(self):
# 		return rgb_to_hsv(self.rgb_tuple)
# 
# 	@property
# 	def h(self):
# 		return self.hsv_tuple[0]
# 
# 	@property
# 	def s(self):
# 		return self.hsv_tuple[1]
# 
# 	@property
# 	def v(self):
# 		return self.hsv_tuple[2]
# 
# 	def rgba_tuple(self, a):
# 		return (self.r, self.g, self.b, a)
# 
# 	def __repr__(self):
# 		return self.hex
# 
# 	def __eq__(self, other):
# 		if isinstance(self, other.__class__):
# 			return self.__dict__ == other.__dict__
# 		return False
# 
# 	def __hash__(self):
# 		return self.integer
# 
# 	# blends this color with another color (of the given opacity) and returns the result
# 	def blend(self, color, opacity=0.5):
# 		my_op = 1 - opacity
# 		return Color((
# 			int((self.r * my_op) + (color.r * opacity)),
# 			int((self.g * my_op) + (color.g * opacity)),
# 			int((self.b * my_op) + (color.b * opacity))
# 		))


import re
from .imagetools import Color
]

CARD_REF_TYPES = [
	"active_ability",
	"passive_ability",
	"includes",
	"references"
]

CARD_RARITIES = [
	"Common",
	"Rare",
	"Uncommon"
]

# base_url is https://steamcdn-a.akamaihd.net/apps/artifact/images/deck_art/card_type_{specific}.png
CARD_TYPE_ICON_MAP = {
	"Creep": "creep",
	"Hero": "hero",
	"Spell": "spell",
	"Improvement": "improvement",

	"Armor": "armor",
	"Weapon": "weapon",
	"Consumable": "consumable",
	"Accessory": "health",
	"Deed": "consumable" 
}

CARD_COLOR_MAP = {

# Path: cogs/utils/imagetools.py
# class Color():
# 	def __init__(self, value):
# 		if isinstance(value, Color):
# 			value = value.hex
# 		if isinstance(value, str):
# 			if not re.match(r"#?[0-9a-fA-F]{6}$", value):
# 				raise ValueError("Color given invalid hex color")
# 			value = value.lstrip("#")
# 			lv = len(value)
# 			self.r, self.g, self.b = tuple(int(value[i:i + lv // 3], 16) for i in range(0, lv, lv // 3))
# 		elif isinstance(value, tuple):
# 			if len(value) == 3:
# 				self.r, self.g, self.b = value
# 			elif len(value) == 4: # throw away alpha here
# 				self.r, self.g, self.b, a = value
# 			else:
# 				raise ValueError("Wrong number of values in tuple")
# 		else:
# 			raise ValueError("Unexpected type given to Color constructor")
# 
# 	@property
# 	def integer(self):
# 		return int(self.hex[1:], 16)
# 
# 	@property
# 	def hex(self):
# 		return "#{0:02x}{1:02x}{2:02x}".format(self.r, self.g, self.b)
# 
# 	@property
# 	def rgb_tuple(self):
# 		return (self.r, self.g, self.b)
# 
# 	@property
# 	def hsv_tuple(self):
# 		return rgb_to_hsv(self.rgb_tuple)
# 
# 	@property
# 	def h(self):
# 		return self.hsv_tuple[0]
# 
# 	@property
# 	def s(self):
# 		return self.hsv_tuple[1]
# 
# 	@property
# 	def v(self):
# 		return self.hsv_tuple[2]
# 
# 	def rgba_tuple(self, a):
# 		return (self.r, self.g, self.b, a)
# 
# 	def __repr__(self):
# 		return self.hex
# 
# 	def __eq__(self, other):
# 		if isinstance(self, other.__class__):
# 			return self.__dict__ == other.__dict__
# 		return False
# 
# 	def __hash__(self):
# 		return self.integer
# 
# 	# blends this color with another color (of the given opacity) and returns the result
# 	def blend(self, color, opacity=0.5):
# 		my_op = 1 - opacity
# 		return Color((
# 			int((self.r * my_op) + (color.r * opacity)),
# 			int((self.g * my_op) + (color.g * opacity)),
# 			int((self.b * my_op) + (color.b * opacity))
# 		))


# Path: cogs/utils/card.py
import re
from .imagetools import Color

]

CARD_REF_TYPES = [
	"active_ability",
	"passive_ability",
	"includes",
	"references"
]

CARD_RARITIES = [
	"Common",
	"Rare",
	"Uncommon"
]

# base_url is https://steamcdn-a.akamaihd.net/apps/artifact/images/deck_art/card_type_{specific}.png
CARD_TYPE_ICON_MAP = {
	"Creep": "creep",
	"Hero": "hero",
	"Spell": "spell",
	"Improvement": "improvement",

	"Armor": "armor",
	"Weapon": "weapon",
	"Consumable": "consumable",
	"Accessory": "health",
	"Deed": "consumable" 
}

CARD_COLOR_MAP = {

	"green": Color("#59753f"),