cc 2.X richText 的默认颜色问题

richText.string = 'aaa<color …>CCC; 1.9的 aaa会用 richText.node.color来渲染,到了2.x变成白色了
翻了翻代码
_applyTextAttribute (labelNode) {
let labelComponent = labelNode.getComponent(cc.Label);
if (!labelComponent) {
return;
}

    let index = labelNode._styleIndex;
    labelComponent.lineHeight = this.lineHeight;
    labelComponent.horizontalAlign = HorizontalAlign.LEFT;
    labelComponent.verticalAlign = VerticalAlign.CENTER;

    let textStyle = null;
    if (this._textArray[index]) {
        textStyle = this._textArray[index].style;
    }

    if (textStyle && textStyle.color) {
        labelNode.color = this._convertLiteralColorValue(textStyle.color);
    }else {
        labelNode.color = this._convertLiteralColorValue("white");
       // label.setColor(this.node.color);   // In version 1.9
    }

这么搞就很郁闷了呀

这个我反馈过给官方,最新版应该是修了吧?你用的是哪个版本。
如果还未必,试试这个贴子的办法:
https://forum.cocos.com/t/richtext/69558

之前漏了这个,已经修复了,但是可以通过设置节点颜色来影响 RichText 的颜色,下个版本应该就能用了

具体的跟你写法差不多

https://github.com/cocos-creator/engine/pull/3672

先自己patch上了;目前用的2.10的,等2.10更新了