Closed
Description
Due to using private properties, every time a Color instance is wrapped in a Proxy, errors are just around the corner.
For context, see:
- https://twitter.com/LeaVerou/status/1650562320702099457
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding
- Error when property value is an instance of a class using private class fields vuejs/core#8149
- Private members break proxies tc39/proposal-class-fields#106
We only use a single private property: #space
, and it's primarily to ensure color space is immutable. We can just use Object.defineProperty()
instead and be done with it.
Edit: There is actually a bunch more privates in space.js but nothing too hard to refactor out.