package com.mime.dualscreenview.common

import com.mime.dualscreenview.R

typealias PairArray<T> = Array<Pair<String,T>>
val colorz : PairArray<Array<String>> = arrayOf<Pair<String,Array<String>>>(
    Pair("color set 01",arrayOf<String>("#E1F5FE", "#263238")),
    Pair("color set 02",arrayOf<String>("#F0F4C3", "#37474F")),
    Pair("color set 03",arrayOf<String>("#ECEFF1", "#455A64")),
    Pair("color set 04",arrayOf<String>("#E0F7FA", "#263238")),
    Pair("color set 05",arrayOf<String>("#F5F5F5", "#263238")),
    Pair("color set 06",arrayOf<String>("#ECEFF1", "#263238")),
    Pair("color set 07",arrayOf<String>("#F8BBD0", "#263238")),
    Pair("color set 08",arrayOf<String>("#E6EE9C", "#455A64")),
    Pair("color set 09",arrayOf<String>("#CFD8DC", "#455A64")),
    Pair("color set 10",arrayOf<String>("#FFF59D", "#37474F"))
)
val typesfacez : PairArray<Int> = arrayOf<Pair<String,Int>>(
    Pair("정선 아리랑 혼", R.font.jsarirang_hon),
    Pair("정선 아리랑 뿌리", R.font.jsarirang_ppuri),
    Pair("정선 동강 레귤러", R.font.jsdongkang_regular),
    Pair("손기정체", R.font.kcc_sonkeechung),
    Pair("교보 손글씨", R.font.kyobo_handwriting_2021sjy),
    Pair("태백 은하수", R.font.taebaek_milkyway),
)

@JvmName("getIndexAny")
fun PairArray<Any>.getIndex(key : String) = getIndex(this, key)
fun getIndex(collection : PairArray<Any>, key : String) : Int {
    var index = 0
    var returns = 0
    for (item in collection) {
        if(item.first.equals(key)) {
            returns = index
        }
        index = index.inc()
    }
    return returns
}