I was animating a conic gradient but the colour was not changing smoothly I have seen various articles but I was not able to replicate them properly You can find my code here:
<style>
body{
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.pyramid {
width: 500px;
height: 500px;
background-image: conic-gradient(red 135deg, green 135deg,yellow 165deg, yellow 165deg);
clip-path: polygon(50% 50%, 0% 100%, 100% 100%);
animation: change 1s ease infinite;
}
.pyramid:hover{
background-image: conic-gradient(red 135deg, #cadfca 135deg,#dddd3f 165deg, #aeae30 165deg);
}
@keyframes change{
0%{
background-image: conic-gradient(red 135deg, yellow 135deg,yellow 165deg, lightpink 165deg);
/*background: red;*/
}
50%{
background-image: conic-gradient(red 135deg, #cadfca 135deg,#dddd3f 165deg, #aeae30 165deg);
}
100%{
background-image: conic-gradient(red 135deg, #565644 135deg,#838314 165deg, #a68f03 165deg)
}
}
</style>
</head>
<body>
<div class="pyramid">
</div>
</body>
How to change it smoothly