Implement proper unit bezier easing function

Code based on WebKit
https://github.com/WebKit/WebKit/blob/main/Source/WebCore/platform/graphics/UnitBezier.h
This commit is contained in:
Kovid Goyal
2024-07-17 10:06:18 +05:30
parent f090c9a895
commit fc13b06b35
8 changed files with 308 additions and 66 deletions

View File

@@ -56,6 +56,10 @@ def positive_float(x: ConvertibleToNumbers) -> float:
return max(0, float(x))
def percent(x: str) -> float:
return float(x.rstrip('%')) / 100.
def to_color(x: str) -> Color:
ans = as_color(x, validate=True)
if ans is None: # this is only for type-checking