Templated color model fitting