Last active
September 28, 2016 15:40
-
-
Save mattsilber/4d9970bf54b81110b6b97cf21845427e to your computer and use it in GitHub Desktop.
Instagram's crappy colors in a ShaderFactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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