As Kaa was thoroughly enjoying putting Bagheera under again, we can also see it wasn't really a question for him if he would succeed. He widens his eyes in glee before admiring his prey before him being totally clueless and happy. You can see Kaa thinking about all the things he could do to them in their blissful state. He unfortunately forgot about the mancub who was trying to throw him off because of this and gets sent offscreen.
Meanwhile Bagheera is happily subdued by the colors. His mind making sure to keep those colors going and eagerly waiting for anything Kaa might do. Before Kaa disappears we can see his spirals going quite quickly. He cycles through all the colors in those 2 seconds. Later when Kaa has fallen down we can see that the colors in Bagheera's eyes have slowed down a bit. Still hopelessly addicted but without commands or more stimuli from Kaa it might be that Bagheera automatically goes into a slow preserving state. Making sure he can last a long time.
As Mowgli yells and shakes Bagheera we can see that he doesn't register anything. The mancub and the whole outer world are not important. It takes a solid 2 seconds of repeatedly hitting him in the face to make him sort of regain his senses. And with his eyes closed he still keeps on smiling, and even when he opens his eyes without the colors for the first time he still has a big smile on his face. After a couple of more smacks his mind gets back to normal but clearly distraught and struggling to remember what had even happened. Probably an intended side effect of Kaa hypnosis. Leaving a trace of the feeling of hypnosis but not the actual memories during hypnosis or induction.
Just a shame Mowgli was smart enough to help the panther out instead of watching him enjoy the hypnosis for a bit.










