diff --git a/pyjecteur/common.py b/pyjecteur/common.py index 7db35fa..62b45b4 100644 --- a/pyjecteur/common.py +++ b/pyjecteur/common.py @@ -5,6 +5,9 @@ from enum import Enum LedBarLen = 16 +def elongate(colors: List[Color], factor: int) -> List[Color]: + return [[elt] * factor for elt in colors] + def remove_duplicates(colors: List[Color]) -> Tuple[List[Color], List[int]]: if len(colors) == 0: return ([], []) @@ -21,7 +24,7 @@ def remove_duplicates(colors: List[Color]) -> Tuple[List[Color], List[int]]: def reduplicate(colors: List[Color], repetitions: List[int]) -> List[Color]: """ Re-duplicates a list. Takes in a list of elements and a list of numbers of - repetitions. Concatetantes the repeted elements. + repetitions. Concatenates the repeted elements. Requires both lists to have the same length """