-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(i3s): Add an option to multiply colors by attribute #2519
Conversation
if (options.i3s.colorsByAttribute.mode === 'multiply') { | ||
const multupliedColor = colors.value.subarray(i * 4, i * 4 + 3); | ||
for (let j = 0; j < 4; j++) { | ||
multupliedColor[j] = (multupliedColor[j] * color[j]) / 255; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
multupliedColor[j] = (multupliedColor[j] * color[j]) / 255; | |
multipliedColor[j] = (multipliedColor[j] * color[j]) / 255; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
/* eslint max-statements: ["error", 30] */ | ||
/* eslint complexity: ["error", 12] */ | ||
if (options.i3s.colorsByAttribute.mode === 'multiply') { | ||
const multupliedColor = colors.value.subarray(i * 4, i * 4 + 3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Generates a lot of small objects, perf / GC.
What happens if you just multiply all elements in the array "in situ"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be working fine, fixed
@belom88 Please review