package com.casic.dcms.utils;

import android.content.Context;
import android.graphics.Color;

import java.util.Random;

/**
 * @Author: Pengxh
 * @Time: 2021/4/12 10:11
 * @Email: 290677893@qq.com
 **/
public class ColorHelper {
    public static int getResourcesColor(Context context, int res) {
        return context.getResources().getColor(res);
    }

    /**
     * 随机颜色
     */
    public static int getRandomColor() {
        Random random = new Random();
        int red = random.nextInt(256);
        int green = random.nextInt(256);
        int blue = random.nextInt(256);
        return Color.rgb(red, green, blue);
    }
}
