index for paint and cache of result