Skip to content

Instantly share code, notes, and snippets.

@brccabral
Last active September 11, 2022 19:06
Show Gist options
  • Save brccabral/2a1e101fdd78cb010e8bc8ba0c6d7d12 to your computer and use it in GitHub Desktop.
Save brccabral/2a1e101fdd78cb010e8bc8ba0c6d7d12 to your computer and use it in GitHub Desktop.
Color mixer
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