mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-07-01 12:26:26 +00:00
core.color
This commit is contained in:
10
core/color.py
Normal file
10
core/color.py
Normal file
@ -0,0 +1,10 @@
|
||||
from PySide6.QtGui import QColor
|
||||
|
||||
|
||||
def mixColor(source: QColor, mix: QColor, ratio: float = 0.5):
|
||||
r = round((mix.red() - source.red()) * ratio + source.red())
|
||||
g = round((mix.green() - source.green()) * ratio + source.green())
|
||||
b = round((mix.blue() - source.blue()) * ratio + source.blue())
|
||||
a = round((mix.alpha() - source.alpha()) * ratio + source.alpha())
|
||||
|
||||
return QColor(r, g, b, a)
|
Reference in New Issue
Block a user