How to make a smooth exit in @keyframes?

Hi! Please help me to configure the background color. For example, I'm black nice and slow, and come out of it dramatically. Is it possible to make the output of the last background to the first in the cycle was smooth?

thank you!

.regulation {
 padding-bottom: 3%;
 animation: colorchange 100s infinite;
}
@keyframes colorchange {
 0% {
 background: #1bacff;
}
 50% {
 background: #312785;
}
 100% {
 background: black;
}
}
April 3rd 20 at 17:42
3 answers
April 3rd 20 at 17:44
Solution
Add frames, inserting black in the middle (50%).
April 3rd 20 at 17:46
Solution
thank you very much =) - dejuan commented on April 3rd 20 at 17:49
April 3rd 20 at 17:48
Solution
animation-direction: alternate;
thank you! great solution! - dejuan commented on April 3rd 20 at 17:51

Find more questions by tags CSS