Added destauration accent color

This commit is contained in:
h4h13 2019-10-10 23:32:59 +05:30
parent 694e78e92e
commit 576201bfd5
5 changed files with 20 additions and 20 deletions

View file

@ -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);
}