Added destauration accent color
This commit is contained in:
parent
694e78e92e
commit
576201bfd5
5 changed files with 20 additions and 20 deletions
|
@ -34,6 +34,14 @@ import code.name.monkey.appthemehelper.util.ColorUtil;
|
|||
import code.name.monkey.retromusic.R;
|
||||
|
||||
public class RetroColorUtil {
|
||||
public static int desaturateColor(int color, float ratio) {
|
||||
float[] hsv = new float[3];
|
||||
Color.colorToHSV(color, hsv);
|
||||
|
||||
hsv[1] = ( hsv[1] / 1 * ratio ) + ( 0.2f * (1.0f - ratio) );
|
||||
|
||||
return Color.HSVToColor(hsv);
|
||||
}
|
||||
public static int toolbarColor(@NonNull Context context) {
|
||||
return ATHUtil.INSTANCE.resolveColor(context, R.attr.colorSurface);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue