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

Function _getBrightness

gui/utils/color.py:36–42  ·  view source on GitHub ↗

Calculates brightness of color http://stackoverflow.com/a/596243/788054

(color)

Source from the content-addressed store, hash-verified

34
35
36def _getBrightness(color):
37 """
38 Calculates brightness of color
39 http://stackoverflow.com/a/596243/788054
40 """
41 r, g, b, a = color
42 return 0.299 * r + 0.587 * g + 0.114 * b
43
44
45def GetSuitable(color, factor: [0, 1]):

Callers 1

GetSuitableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected