Move color parsing code to C for performance

This commit is contained in:
Kovid Goyal
2025-12-30 21:43:57 +05:30
parent a4d88beddb
commit 7c13c04c84
4 changed files with 318 additions and 437 deletions

View File

@@ -65,10 +65,10 @@ class TestDataTypes(BaseTest):
def c(spec, r=0, g=0, b=0, a=0):
c = to_color(spec)
self.ae(c.red, r)
self.ae(c.green, g)
self.ae(c.blue, b)
self.ae(c.alpha, a)
self.ae(c.red, r, spec)
self.ae(c.green, g, spec)
self.ae(c.blue, b, spec)
self.ae(c.alpha, a, spec)
c('#eee', 0xee, 0xee, 0xee)
c('#234567', 0x23, 0x45, 0x67)