Skip to content

Commit 7e1db20

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent dcdfc91 commit 7e1db20

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

branca/utilities.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ def linear_gradient(hexList: List[str], nColors: int) -> List[str]:
7171
for start, end in zip(hexList[:-1], hexList[1:]):
7272
# Linearly interpolate between pair of hex ###### values and
7373
# add to list.
74-
start = [int(start[i:i+2], 16) for i in (1, 3, 5)]
75-
end = [int(end[i:i+2], 16) for i in (1, 3, 5)]
74+
start = [int(start[i : i + 2], 16) for i in (1, 3, 5)]
75+
end = [int(end[i : i + 2], 16) for i in (1, 3, 5)]
7676

7777
n_interpolate = 765
7878
for i in range(n_interpolate):

tests/test_utilities.py

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,33 @@ def test_write_png_rgb():
177177
[
178178
(["#000000", "#FFFFFF"], 2, ["#000000", "#ffffff"]),
179179
(["#FF0000", "#00FF00", "#0000FF"], 3, ["#ff0000", "#00ff00", "#0000ff"]),
180-
(["#000000", "#0000FF"], 5, ['#000000', '#00003f', '#00007f', '#0000bf', '#0000ff']),
181-
(["#FFFFFF", "#000000"], 5, ['#ffffff', '#bfbfbf', '#7f7f7f', '#3f3f3f', '#000000']),
182-
(["#FF0000", "#00FF00", "#0000FF"], 7, ['#ff0000', '#aa5400', '#55a900', '#00ff00', '#00aa54', '#0055a9', '#0000ff']),
183-
]
180+
(
181+
["#000000", "#0000FF"],
182+
5,
183+
["#000000", "#00003f", "#00007f", "#0000bf", "#0000ff"],
184+
),
185+
(
186+
["#FFFFFF", "#000000"],
187+
5,
188+
["#ffffff", "#bfbfbf", "#7f7f7f", "#3f3f3f", "#000000"],
189+
),
190+
(
191+
["#FF0000", "#00FF00", "#0000FF"],
192+
7,
193+
[
194+
"#ff0000",
195+
"#aa5400",
196+
"#55a900",
197+
"#00ff00",
198+
"#00aa54",
199+
"#0055a9",
200+
"#0000ff",
201+
],
202+
),
203+
],
184204
)
185-
def test_linear_gradient(hex_list: List[str], n_colors: int, expected_output: List[str]):
205+
def test_linear_gradient(
206+
hex_list: List[str], n_colors: int, expected_output: List[str],
207+
):
186208
result = ut.linear_gradient(hex_list, n_colors)
187209
assert result == expected_output

0 commit comments

Comments
 (0)