Skip to content

Instantly share code, notes, and snippets.

@mattsilber
Last active September 28, 2016 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattsilber/4d9970bf54b81110b6b97cf21845427e to your computer and use it in GitHub Desktop.
Save mattsilber/4d9970bf54b81110b6b97cf21845427e to your computer and use it in GitHub Desktop.
Instagram's crappy colors in a ShaderFactory
ShapeDrawable.ShaderFactory factory = new ShapeDrawable.ShaderFactory() {
public Shader resize(int width, int height) {
final int[] colors = new int[]{ 0xFFFCDB7C, 0xFFE21C4D, 0xFF4832DF };
final float[] anchors = new float[]{ 0, .5f, 1 };
return new RadialGradient(width / 10, height, (float) (width * .8), colors, anchors, Shader.TileMode.CLAMP);
}
};
# Drawable.setShaderFactory(factory);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment