How to animate the fill colors of a 2D drawing?
This might suit your needs:
In the Timeline window or Graph Editor window set the Playhead (the blue marker) on frame 1.
Go to the Material Properties of your object and select a material you want to have change color. In the same panel go to Surface &gt; Fill and hover your mouse cursor over the color. Press I. You've now created a keyframe for animating this color, and it should show up as a diamond icon on the Timeline and as a point in the Graph Editor.
Now set the Playhead (blue marker) on frame 2 and go back to the the fill color of your material and change it to another color(. Mouse hover over it again and press I again.
Now set the Playhead (blue marker) on frame 3. Go back to the the fill color of your material and change it back to the first initial color (or possibly to another third color). Mouse hover over it again and press I again. (a third keyframe is needed because the next step does not seem to work with only two)
When you have a nice cycle of color change that you want to repeat, you could repeat this process manually, but less labor intensive is to do it using the Graph Editor.
Select all the keyframes in the Graph Editor, press Shift + E and choose Make Cyclic (F-Modifier). You've now added a modifier that can be found (or also could have been added) in the Modifier tab of the Graph Editor N-Panel. (you can extend or collapse it by pressing N in the graph Editor)

Now if you hit Play Animation on the Timeline the material will rapidly change color, giving a flashing effect.
If you want if to change color slower, select al the keyframes in the Graph Editor, press S (and then X) to scale the distance in time between them. That might look something like this:

Alternatively, if you would want a material to be one color for (for instance) 20 frames, and then instantly change to another color and remain that color for 20 frames. you can use two keyframes per color to indicate a length of time on the Timeline. That would look like this, with the keyframes of one color on the left side (of frame 21) and the keyframes of another on the right.


Hope that helps : )