Commit 62395235 authored by rockyl's avatar rockyl

文本处理增加单一颜色

parent e63747e6
...@@ -258,6 +258,8 @@ async function execute$1(psdFile, options) { ...@@ -258,6 +258,8 @@ async function execute$1(psdFile, options) {
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun; const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue; properties.text = fontInfo.textValue;
let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = { properties.textflow = {
fonts, styles, RunLengthArray, fonts, styles, RunLengthArray,
}; };
......
This diff is collapsed.
...@@ -264,6 +264,8 @@ async function execute$1(psdFile, options) { ...@@ -264,6 +264,8 @@ async function execute$1(psdFile, options) {
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun; const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue; properties.text = fontInfo.textValue;
let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = { properties.textflow = {
fonts, styles, RunLengthArray, fonts, styles, RunLengthArray,
}; };
......
This diff is collapsed.
...@@ -264,6 +264,8 @@ ...@@ -264,6 +264,8 @@
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun; const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue; properties.text = fontInfo.textValue;
let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = { properties.textflow = {
fonts, styles, RunLengthArray, fonts, styles, RunLengthArray,
}; };
......
This diff is collapsed.
...@@ -108,6 +108,8 @@ async function execute(psdFile, options) { ...@@ -108,6 +108,8 @@ async function execute(psdFile, options) {
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun; const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue; properties.text = fontInfo.textValue;
let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = { properties.textflow = {
fonts, styles, RunLengthArray, fonts, styles, RunLengthArray,
}; };
...@@ -127,7 +129,7 @@ async function execute(psdFile, options) { ...@@ -127,7 +129,7 @@ async function execute(psdFile, options) {
const uuid = generateUUID(); const uuid = generateUUID();
const ext = '.png'; const ext = '.png';
properties.source = 'asset|' + uuid; properties.source = 'asset://' + uuid;
const imageFilePath = path.join(imagesPath, uuid + ext); const imageFilePath = path.join(imagesPath, uuid + ext);
await fs.ensureDir(path.dirname(imageFilePath)); await fs.ensureDir(path.dirname(imageFilePath));
...@@ -143,6 +145,7 @@ async function execute(psdFile, options) { ...@@ -143,6 +145,7 @@ async function execute(psdFile, options) {
name, name,
ext, ext,
uuid, uuid,
hash: hashFileName,
}); });
} }
} }
......
This diff is collapsed.
...@@ -51,6 +51,8 @@ export async function execute(psdFile, options) { ...@@ -51,6 +51,8 @@ export async function execute(psdFile, options) {
const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun; const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties.text = fontInfo.textValue; properties.text = fontInfo.textValue;
let [r, g, b, a] = fontInfo.colors()[0];
properties.color = `rgba(${r}, ${g}, ${b}, ${a / 255})`;
properties.textflow = { properties.textflow = {
fonts, styles, RunLengthArray, 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