mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 20:41:41 +09:00
Added ligten to player colours
This commit is contained in:
@@ -26,6 +26,11 @@ local function compact(colour)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Returns a colour that is a bit lighter than the one given
|
||||||
|
local function lighten(c)
|
||||||
|
return {r = 1 - (1 - c.r) * 0.5, g = 1 - (1 - c.g) * 0.5, b = 1 - (1 - c.b) * 0.5, a = 1}
|
||||||
|
end
|
||||||
|
|
||||||
--- When your data loads apply the players colour, or a random on if none is saved
|
--- When your data loads apply the players colour, or a random on if none is saved
|
||||||
PlayerColours:on_load(function(player_name, player_colour)
|
PlayerColours:on_load(function(player_name, player_colour)
|
||||||
if not player_colour then
|
if not player_colour then
|
||||||
@@ -37,7 +42,7 @@ PlayerColours:on_load(function(player_name, player_colour)
|
|||||||
while config.disallow[colour_name] do
|
while config.disallow[colour_name] do
|
||||||
colour_name = table.get_random_dictionary_entry(Colours, true)
|
colour_name = table.get_random_dictionary_entry(Colours, true)
|
||||||
end
|
end
|
||||||
player_colour = {Colours[colour_name], Colours[colour_name]}
|
player_colour = {Colours[colour_name], lighten(Colours[colour_name])}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user