Open alexanderGugel opened 9 years ago
@michaelobriena
So I might be asking dumb questions here...
@jd-carroll The Color component in a way violates the existing abstractions in the platform. The Color component is not a component. Components define behavior on Nodes, but the color component is only being used for defining the base color of meshes etc.
The color component can only be added to a Mesh, not to a Node.
Can an individual color component be tied to an individual DOMElement?
No. The Color component is only being used for GL.
Color is not a component. I don't think it was ever intended to be. It is just Transitionables for tweening colors.
If we roll the functionality into Mesh I am ok with this. But for solid base colors it is super nice to tween them between values.
The
Color
component inutilities/Color.js
has an opacity property that is being managed using aTransitionable
(just like theRGB
values).Opacity
component).RGBA
is for).Aside from that, the
Mesh
itself - more or less - has a dependency on the Color component (or at least requires it to expose anisActive
method), therefore the two concepts are not really decoupled.I propose the following changes:
requestUpdate
in Mesh when a component is active (this violates the current abstraction - the Color component should do that) - seeMesh#onUpdate