Download Pixel Perfect Outline Shader from Asset Store and import it into your project.
Add Sprite Outline component to your Game Object with attached Sprite Renderer.
Set PixelPerfectOutline as Sprite Renderer material.
Now you can change Outline Color in Inspector or via Animation.
Set Outline Color from your scripts.