package com.casic.dcms.utils;

import android.content.Context;

import com.pengxh.androidx.lite.kit.IntKit;

import java.util.ArrayList;
import java.util.Random;

public class ColorKit {
    /**
     * 随机生成颜色
     */
    public static int[] generateColor(Context context) {
        ArrayList<int[]> colorCollection = new ArrayList<>(LocaleConstant.BACKGROUND_COLOR.size());

        for (int i = 0; i < LocaleConstant.BACKGROUND_COLOR.size(); i++) {
            colorCollection.add(new int[]{LocaleConstant.BACKGROUND_COLOR.get(i), LocaleConstant.TEXT_COLOR.get(i)});
        }

        int[] colorArray = colorCollection.get(new Random().nextInt(colorCollection.size()));
        return new int[]{IntKit.convertColor(context, colorArray[0]), IntKit.convertColor(context, colorArray[1])};
    }
}
