mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-14 14:02:49 +00:00
Change the default colors of the TextDrawable color generator
This commit is contained in:
parent
ad0dfab5ee
commit
507bf3ac90
1 changed files with 26 additions and 1 deletions
|
@ -5,7 +5,32 @@ import android.view.View;
|
|||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class TextDrawableHelper {
|
||||
// taken from: https://materialuicolors.co (level 700)
|
||||
private static ColorGenerator _generator = ColorGenerator.create(Arrays.asList(
|
||||
0xFFD32F2F,
|
||||
0xFFC2185B,
|
||||
0xFF7B1FA2,
|
||||
0xFF512DA8,
|
||||
0xFF303F9F,
|
||||
0xFF1976D2,
|
||||
0xFF0288D1,
|
||||
0xFF0097A7,
|
||||
0xFF00796B,
|
||||
0xFF388E3C,
|
||||
0xFF689F38,
|
||||
0xFFAFB42B,
|
||||
0xFFFBC02D,
|
||||
0xFFFFA000,
|
||||
0xFFF57C00,
|
||||
0xFFE64A19,
|
||||
0xFF5D4037,
|
||||
0xFF616161,
|
||||
0xFF455A64
|
||||
));
|
||||
|
||||
private TextDrawableHelper() {
|
||||
|
||||
}
|
||||
|
@ -18,7 +43,7 @@ public class TextDrawableHelper {
|
|||
text = fallback;
|
||||
}
|
||||
|
||||
int color = ColorGenerator.MATERIAL.getColor(text);
|
||||
int color = _generator.getColor(text);
|
||||
return TextDrawable.builder().beginConfig()
|
||||
.width(view.getLayoutParams().width)
|
||||
.height(view.getLayoutParams().height)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue