It seems that the duration property of my tween acts on all other properties except for the color property.
I am simply wanting a gradual change in color from black to brown. Would someone enlighten me on this?
const Title = () => {
const [titleColor, setTitleColor] = useState(true);
const title = useRef(null);
useLayoutEffect(() => {
let ctx = gsap.context(() => {
gsap.to(title.current, { duration: 3, x: "20px", color: "brown", scale: 1.5, ease: "power1.in" });
}, titleColor);
return () => ctx.revert();
}, [titleColor]);
return (
<div className="container">
<p className="title" ref={title}>
Title
</p>
</div>
);
};