Skip to content

Commit

Permalink
add Color special handling
Browse files Browse the repository at this point in the history
  • Loading branch information
star-e committed Oct 15, 2024
1 parent 198d82e commit 872df78
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions native/tools/gfx-define-generator/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,17 @@ for (const name of Object.keys(structMap)) {

output += ` ) {}\n`;

if (name === 'Color') {
output += `\n`;
output += ` public set (x: number, y: number, z: number, w: number): Color {\n`;
output += ` this.x = x;\n`;
output += ` this.y = y;\n`;
output += ` this.z = z;\n`;
output += ` this.w = w;\n`;
output += ` return this;\n`;
output += ` }\n`;
}

if (!Object.keys(struct.member).some((k) => struct.member[k].readonly)) {
output += `\n public copy (info: Readonly<${name}>): ${name} {\n`;
for (const key in struct.member) {
Expand Down

0 comments on commit 872df78

Please sign in to comment.