Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
perf: improve performance by avoiding reallocation
Wenzhao Hu0eb517019eba
diff --git a/packages/engine-render/src/services/invert-rgb.ts b/packages/engine-render/src/services/invert-rgb.tsindex 613bc3d8ea..2a245c8aa3 100644--- a/packages/engine-render/src/services/invert-rgb.ts+++ b/packages/engine-render/src/services/invert-rgb.ts@@ -17,14 +17,14 @@import type { RGBColor } from './utils';import { denormalizeRGBColor, normalizeRGBColor } from './utils';-function invertNormalizedColorByMatrix(color: RGBColor): RGBColor {- const matrix = [- [0.333, -0.667, -0.667, 0, 1],- [-0.667, 0.333, -0.667, 0, 1],- [-0.667, -0.667, 0.333, 0, 1],- [0, 0, 0, 1, 0],- ];+const matrix = [+ [0.333, -0.667, -0.667, 0, 1],+ [-0.667, 0.333, -0.667, 0, 1],+ [-0.667, -0.667, 0.333, 0, 1],+ [0, 0, 0, 1, 0],+];+function invertNormalizedColorByMatrix(color: RGBColor): RGBColor {const r = color[0];const g = color[1];const b = color[2];