package net.pokeranalytics.android.util

import android.content.Context
import android.graphics.Color
import net.pokeranalytics.android.R
import java.util.*

class ColorUtils {

	companion object {

		fun almostRandomColor(index: Int, context: Context) : Int {

			return when (index) {
				0 -> context.getColor(R.color.green_light)
				1 -> context.getColor(R.color.blue)
				2 -> context.getColor(R.color.red)
				3 -> context.getColor(R.color.purple)
				4 -> Color.CYAN
				5 -> Color.MAGENTA
				6 -> Color.YELLOW
				else -> {
					val rd = Random()
					val r = 128 + rd.nextInt(127)
					val g = 128 + rd.nextInt(127)
					val b = 128 + rd.nextInt(127)
					Color.argb(255, r, g, b)
				}
			}

		}

	}

}