You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
LeaVerou
changed the title
Color.js OO API cannot be wrapped in a Proxy (and thus, cannot be used with Vue)
Color.js OO API cannot be wrapped in a Proxy (and thus, cannot be used with Vue or other Proxy-based libraries)
Apr 28, 2023
LeaVerou
changed the title
Color.js OO API cannot be wrapped in a Proxy (and thus, cannot be used with Vue or other Proxy-based libraries)
Color.js objects cannot be wrapped in a Proxy (and thus, cannot be used with Vue or other Proxy-based libraries)
Apr 28, 2023
It is actually worse than I thought: this even affects plain color objects, as they still use ColorSpace objects.
It is unclear if there is a way to definitively check color space equality without using object equality. In #306 I fall back to string comparison of ids, but that's …not great.
Due to using private properties, every time a Color instance is wrapped in a Proxy, errors are just around the corner.
For context, see:
We only use a single private property:
#space
, and it's primarily to ensure color space is immutable. We can just useObject.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.
The text was updated successfully, but these errors were encountered: