Commit 62395235 authored by rockyl's avatar rockyl

文本处理增加单一颜色

parent e63747e6
......@@ -258,6 +258,8 @@ async function execute$1(psdFile, options) {
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue;
let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = {
fonts, styles, RunLengthArray,
};
......
This diff is collapsed.
......@@ -264,6 +264,8 @@ async function execute$1(psdFile, options) {
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue;
let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = {
fonts, styles, RunLengthArray,
};
......
This diff is collapsed.
......@@ -264,6 +264,8 @@
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue;
let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = {
fonts, styles, RunLengthArray,
};
......
This diff is collapsed.
......@@ -108,6 +108,8 @@ async function execute(psdFile, options) {
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue;
let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = {
fonts, styles, RunLengthArray,
};
......@@ -127,7 +129,7 @@ async function execute(psdFile, options) {
const uuid = generateUUID();
const ext = '.png';
properties.source = 'asset|' + uuid;
properties.source = 'asset://' + uuid;
const imageFilePath = path.join(imagesPath, uuid + ext);
await fs.ensureDir(path.dirname(imageFilePath));
......@@ -143,6 +145,7 @@ async function execute(psdFile, options) {
name,
ext,
uuid,
hash: hashFileName,
});
}
}
......
This diff is collapsed.
......@@ -51,6 +51,8 @@ export async function execute(psdFile, options) {
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue;
let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = {
fonts, styles, RunLengthArray,
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment