• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Difference between revisions of "Module:EnemyColors"

From Kancolle Wiki
Jump to navigation Jump to search
com>Ckwng
(Created page with "local EnemyColors = { _common_background_color = "darkgrey", _background_color = "grey", _background_image = "background-image: radial-gradient(circle farthest-corner at ce...")
 
com>Ckwng
Line 11: Line 11:
 
}
 
}
  
function EnemyColors.rarity_colors(ship)
+
function EnemyColors:rarity_colors(ship)
 
local rarity = ship:rarity()
 
local rarity = ship:rarity()
 
local bg_color
 
local bg_color

Revision as of 07:26, 10 February 2016

Documentation for this module may be created at Module:EnemyColors/doc

local EnemyColors = {
	_common_background_color = "darkgrey",
	_background_color = "grey",
	_background_image = "background-image: radial-gradient(circle farthest-corner at center center , rgba(102, 102, 102, 0) 0%, rgba(102, 102, 102, 0) 60%, rgb(102, 102, 102) 100%);",
	_plain_rare_background_image = "background-image: radial-gradient(circle farthest-corner at center center , rgba(102, 102, 102, 0) 0%, rgba(102, 102, 102, 0.4) 60%, rgba(77, 77, 77, 0.7) 100%);",
	_elite_glow_background_color = "#c95050",
	_mid_boss_background_color = "#A67474",
	_mid_boss_background_image = "background-image: radial-gradient(circle farthest-corner at center center , rgba(140, 98, 98, 0) 0%, rgba(140, 98, 98, 0) 60%, rgb(140, 98, 98) 100%);",
	_rare_background_color = "#B04040",
	_rare_background_image = "background-image: radial-gradient(circle farthest-corner at center center , #C04040 0%, #B04040 80%, #A04040);",
}

function EnemyColors:rarity_colors(ship)
	local rarity = ship:rarity()
	local bg_color
	local extra_style = ""
	if rarity then
		if rarity >= 4 and rarity <= 7 then
			if rarity == 5 then
				bg_color = self._elite_glow_background_color
			elseif rarity == 6.5 then
				bg_color = self._mid_boss_background_color
				extra_style = self._mid_boss_background_image
			else
				bg_color = self._background_color
				if rarity == 7 then
					extra_style = self._plain_rare_background_image
				elseif rarity == 6 then
					extra_style = self._background_image
				end
			end
		elseif rarity < 4 then
			bg_color = self._common_background_color
		else
			bg_color = self._rare_background_color
			extra_style = self._rare_background_image
		end
	else
		bg_color = self._common_background_color
	end
	return bg_color, extra_style
end

return EnemyColors