Last active
September 11, 2022 19:06
-
-
Save brccabral/2a1e101fdd78cb010e8bc8ba0c6d7d12 to your computer and use it in GitHub Desktop.
Color mixer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Tuple | |
def color_mixer( | |
color1: Tuple[int, int, int], color2: Tuple[int, int, int], weight1: float | |
): | |
return tuple( | |
[ | |
int(weight1 * mix[1] + (1.0 - weight1) * mix[0]) | |
for mix in zip(color1, color2) | |
] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment