How to make a fill feature for a drawing system

Hi everyone. I was wondering, how could I achieve a full system with a gui type drawing system?

Check out this post: Flood Fill For 2D Pixel Paint - #4 by nocm1887cc