MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / Brighten

Function Brighten

gui/utils/color.py:5–15  ·  view source on GitHub ↗

Brightens a Color using a factor between 0 and 1

(color, factor)

Source from the content-addressed store, hash-verified

3
4
5def Brighten(color, factor):
6 """ Brightens a Color using a factor between 0 and 1"""
7 r, g, b, a = color
8
9 factor = min(max(factor, 0), 1)
10
11 r += (255 - r) * factor
12 b += (255 - b) * factor
13 g += (255 - g) * factor
14
15 return wx.Colour(round(r), round(g), round(b), round(a))
16
17
18def Darken(color, factor):

Callers 1

GetSuitableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected