diff --git a/src/style-spec/expression/types/formatted.js b/src/style-spec/expression/types/formatted.js index 6cd74986f9c..0bc5000b4cc 100644 --- a/src/style-spec/expression/types/formatted.js +++ b/src/style-spec/expression/types/formatted.js @@ -31,7 +31,7 @@ export default class Formatted { return this.sections.map(section => section.text).join(''); } - serialize() { + serialize(): Array { const serialized = ["format"]; for (const section of this.sections) { serialized.push(section.text); @@ -43,7 +43,7 @@ export default class Formatted { options["font-scale"] = section.scale; } if (section.textColor) { - options["text-color"] = ["literal", section.textColor]; + options["text-color"] = ["rgba"].concat(section.textColor.toArray()); } serialized.push(options); } diff --git a/test/integration/expression-tests/format/basic/test.json b/test/integration/expression-tests/format/basic/test.json index 2e9e51d62f5..d4a9a32010b 100644 --- a/test/integration/expression-tests/format/basic/test.json +++ b/test/integration/expression-tests/format/basic/test.json @@ -85,15 +85,7 @@ }, "d", { - "text-color": [ - "literal", - { - "a": 1, - "b": 0, - "g": 1, - "r": 0 - } - ] + "text-color": ["rgba", 0, 255, 0, 1] } ] }