Search code examples
aframe

Color Shifting Light in the Aframe


I want to color shift light in the Aframe scene.

If I want to animate the intensity of the light I will add

 animation__intensity=property: light.intensity; from: 0.5; to: 1; dur: 100; dir: alternate; loop: true;

So my idea was if I want to color shift the light I will do

 animation__color=property: light.color; from: red; to: blue; dur: 100; dir: alternate; loop: true;

However, this method does not work. Does anyone have any idea how to solve this problem? Thank you.


Solution

  • The color property should be addressed as an rgb vector, like this:

    animation="property: light.color; from:rgb(200, 70, 30); to:rgb(0, 30, 180); dur: 1500; loop:true; easings: easeInOutSine; dir: alternate; autoplay: true"
    
    

    glitch here