mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 22:44:50 +02:00
Modify ImageMagick wrapper to handle animated images
This commit is contained in:
@@ -11,7 +11,7 @@ from typing import (
|
||||
)
|
||||
|
||||
from ..rgb import Color, to_color as as_color
|
||||
from ..types import ParsedShortcut
|
||||
from ..types import ParsedShortcut, ConvertibleToNumbers
|
||||
from ..utils import expandvars, log_error
|
||||
|
||||
key_pat = re.compile(r'([a-zA-Z][a-zA-Z0-9_-]*)\s+(.+)$')
|
||||
@@ -35,17 +35,6 @@ def to_color_or_none(x: str) -> Optional[Color]:
|
||||
return None if x.lower() == 'none' else to_color(x)
|
||||
|
||||
|
||||
ConvertibleToNumbers = Union[str, bytes, int, float]
|
||||
|
||||
|
||||
def positive_int(x: ConvertibleToNumbers) -> int:
|
||||
return max(0, int(x))
|
||||
|
||||
|
||||
def positive_float(x: ConvertibleToNumbers) -> float:
|
||||
return max(0, float(x))
|
||||
|
||||
|
||||
def unit_float(x: ConvertibleToNumbers) -> float:
|
||||
return max(0, min(float(x), 1))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user