Ah, wait, now I see it. It doesn't work when multiple colors at the end are fully transparent.
`^\xff+\x00+$` should be `^\xff+\x00\xff*$`. Good catch.