It's a little awkward to kick off a flood fill algorithm, because it requires that the old color must be read before it is invoked. It is usually, established by the initial pixel (x, y) where a mouse is clicked.