From 6086f5a46d24956ca5782730e4698bfd10a4fc52 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Fri, 31 May 2024 10:13:54 -0700 Subject: [PATCH] Fix some mypy typing issues Signed-off-by: Alek Ratzloff --- colorhash/cli.py | 2 +- colorhash/color.py | 1 + colorhash/palettes.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/colorhash/cli.py b/colorhash/cli.py index 57ca02f..b8c5f07 100644 --- a/colorhash/cli.py +++ b/colorhash/cli.py @@ -8,7 +8,7 @@ import textwrap from .colorizer import PaletteColorizer from .matricizer import Matricizer, NibbleMatricizer, RandomartMatricizer from .palettes import Palette, DEFAULT_PALETTES, PALETTES -from .writer import ANSIWriter, SVGWriter +from .writer import ANSIWriter, SVGWriter, Writer # TODO - WASM compile for embedding directly in HTML diff --git a/colorhash/color.py b/colorhash/color.py index 2248410..4af4e11 100644 --- a/colorhash/color.py +++ b/colorhash/color.py @@ -10,6 +10,7 @@ class Color(metaclass=abc.ABCMeta): This can be used to convert any color format into another color format. """ + @abc.abstractmethod def to_html_color(self) -> str: """ Convert this color to an HTML color. diff --git a/colorhash/palettes.py b/colorhash/palettes.py index 7e14681..7403eb8 100644 --- a/colorhash/palettes.py +++ b/colorhash/palettes.py @@ -6,7 +6,7 @@ from .color import Color, HSLColor HSLRange = range | float | int | list[float | int] -Palette = Sequence[str] +Palette = Sequence[Color] def quantize(r: range, steps: int = 16) -> list[float]: