Alembic is a Sketch plugin from Awkward. It will extract a color palette from any layer that contains bitmap data. It works for both images and layers with a Pattern fill.