Skip to content

Commit

Permalink
---- last push for base color WITHOUT tint
Browse files Browse the repository at this point in the history
  • Loading branch information
NeylMahfouf2608 committed Feb 5, 2025
1 parent 1a2193d commit 9e00efb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Extensions/3D/JsExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -2421,11 +2421,12 @@ module.exports = {
this._updateTextureUvMapping();
}

updateColor(object) {
_updateColor() {
const colors = [];

const normalizedColor = objectsRenderingService
.hexNumberToRGBArray(this._cube3DRuntimeObject._color)
.hexNumberToRGBArray(
objectsRenderingService.rgbOrHexToHexNumber(this._color)
)
.map((component) => component / 255);

for (
Expand Down Expand Up @@ -2482,7 +2483,7 @@ module.exports = {
this._shouldUseTransparentTexture = shouldUseTransparentTexture;
materialsDirty = true;
}
const color = object.content.color;
const color = object.content.color || '128;128;128';
if (this._color !== color) {
this._color = color;
colorDirty = true;
Expand Down Expand Up @@ -2579,7 +2580,7 @@ module.exports = {

if (materialsDirty) this._updateThreeObjectMaterials();
if (uvMappingDirty) this._updateTextureUvMapping();
if (colorDirty) this.updateColor(object);
if (colorDirty) this._updateColor();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Extensions/JsExtensionTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ declare type ObjectsRenderingService = {
objectConfiguration: gd.ObjectConfiguration
) => string;
rgbOrHexToHexNumber: (value: string) => number;
hexNumberToRGBArray: (value: string) => [number, number, number];
hexNumberToRGBArray: (value: number) => [number, number, number];
registerClearCache: (clearCache: (_: any) => void) => void;
};

Expand Down

0 comments on commit 9e00efb

Please sign in to comment.