package com.remax.visualnovel.widget.uitoken.bean

/**
 * Created by HJW on 2022/8/31
 */
class UIToken(
    var type: Int,
    /**
     * 颜色  type == FILL_COLOR
     */
    var color: Int = 0,

    /**
     * 渐变色  type == LINEAR_GRADIENT
     * textview设置渐变色时，其他状态不会生效
     */
    var colors: IntArray = intArrayOf(),
    var deg: String = "",
    /**
     * 大小单位px  type == SIZE  圆角和描边使用
     */
    var size: Float = 0f,
    /**
     * 字体  type == FONT
     */
    var textFont: TextFont? = null,
    /**
     * 阴影 type == OUTLINE
     */
    var outLine: OutLine? = null
) {
    companion object {
        const val FILL_COLOR = 1 //全填充颜色
        const val LINEAR_GRADIENT = 2 //线性渐变
        const val SIZE = 3 //dimen大小
        const val FONT = 4 //字体
        const val OUTLINE = 5 //阴影
    }

    data class TextFont(
        var typeFace: String = "",
        var textFontSize: Float = 0f, //pix
        var textLineSpace: Float = 0f //pix
    )

    data class OutLine(
        var color: Int = 0,
        var alpha: Float = 1.0f,
        var elevation: Float = 0f,
        var offsetX: Int = 0,
        var offsetY: Int = 0
    )

}

