cc.Class({
    extends: cc.Component,

    properties: {
        colorYellow: '#F67627',
        colorGreen: '#009776',
        colorRed: '#E11C24',
        colorBlue: '#0093CD',
        colorNormal: '#3C3048',
        colorRed2: '#ff1200',
    },

    onLoad() {
        this.label = this.getComponent(cc.Label);
    },

    setData(strColor, letter, fontSize = 30) {
        this.label.fontSize = fontSize;
        this.label.lineHeight = fontSize;
        this.label.string = letter;
        let color = this.colorNormal;
        if (strColor == 'yellow') {
            color = this.colorYellow;
        } else if (strColor == 'green') {
            color = this.colorGreen;
        } else if (strColor == 'red') {
            color = this.colorRed;
        } else if (strColor == 'blue') {
            color = this.colorBlue;
        } else if (strColor == 'normal') {
            color = this.colorNormal;
        } else if (strColor == 'red2') {
            color = this.colorRed2;
        }
        this.color = color;
        this.scheduleOnce(()=>{
            this.node.color = new cc.Color().fromHEX(color);
        })
    },

    setRed(){
        this.node.color = new cc.Color().fromHEX(this.colorRed2);
    },
    setOldColor(){
        this.node.color = new cc.Color().fromHEX(this.color);
    },

    // update (dt) {},
});
