Skip to content

Commit 6141ac0

Browse files
committed
update
1 parent ee567d6 commit 6141ac0

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ namespaces = true
1515

1616
# ----------------------------------------- Project Metadata -------------------------------------
1717
[project]
18-
version = "0.0.0.dev4"
18+
version = "0.0.0.dev5"
1919
name = "PyColorIT"
2020
requires-python = ">=3.10"
2121
dependencies = [
2222
"numpy",
23-
"PkgData",
23+
"PkgData == 0.0.0.dev3",
2424
"ipython",
2525
]

src/pycolorit/gradient.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
"""Create color gradients."""
2+
from __future__ import annotations
3+
4+
from typing import Literal as _Literal, Sequence as _Sequence, TYPE_CHECKING as _TYPE_CHECKING
25

3-
from typing import Literal as _Literal, Sequence as _Sequence
46

57
import numpy as _np
68

79
from pycolorit.color import RGBColor as _RGBColor
10+
from pycolorit import color as _color
811

912

1013
def interpolate(
@@ -47,6 +50,10 @@ def interpolate(
4750
Gradient colors starting with `color_start`.
4851
"""
4952
explicit_alpha = multipliers and len(multipliers) == 4
53+
if not isinstance(color_start, _RGBColor):
54+
color_start = _color.css(str(color_start))
55+
if not isinstance(color_end, _RGBColor):
56+
color_end = _color.css(str(color_end))
5057
c1 = color_start.array(
5158
system=system,
5259
hue_wrap=hue_wrap,

0 commit comments

Comments
 (0)