diff options
| author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-06-14 17:02:32 -0400 |
|---|---|---|
| committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-06-14 17:02:32 -0400 |
| commit | 9866828b7b530b3f748509c55e3bb2c76dadce49 (patch) | |
| tree | ed5922642226cdf15c90dbbb42b2c1c61f526ad1 | |
| parent | 7d4f2c1777f20c47e0f77bd519469ac16a4366b5 (diff) | |
background color done for real (set consistent brightness level, made background lighter)
| -rw-r--r-- | src/client/views/collections/collectionSchema/CollectionSchemaView.tsx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index df160a3a4..ac9b57414 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -524,18 +524,18 @@ export class CollectionSchemaView extends CollectionSubView() { const randomRGBColor = (): string[] => { let r; let g; let b; - do { - r = Math.floor(Math.random() * 256); - g = Math.floor(Math.random() * 256); - b = Math.floor(Math.random() * 256); - } while ((r + g + b) < 400 || (r + g + b) > 450); + const brightness = 450; + r = Math.floor(Math.random() * 256); + g = Math.floor(Math.random() * Math.min(256, brightness - r)); + b = Math.floor(brightness - r - g); - const rL = ClientUtils.lightenRGB(r, g, b, 60)[0]; - const gL = ClientUtils.lightenRGB(r, g, b, 60)[1]; - const bL = ClientUtils.lightenRGB(r, g, b, 60)[2]; - const backgroundRGB = {rL, gL, bL}; + const lightenedRGB = ClientUtils.lightenRGB(r, g, b, 65); + const rL = lightenedRGB[0]; + const gL = lightenedRGB[1]; + const bL = lightenedRGB[2]; + const bgdRGB = {rL, gL, bL}; - return new Array<string>(`rgb(${r}, ${g}, ${b})`, `rgb(${backgroundRGB.rL}, ${backgroundRGB.gL}, ${backgroundRGB.bL})`); + return new Array<string>(`rgb(${r}, ${g}, ${b})`, `rgb(${bgdRGB.rL}, ${bgdRGB.gL}, ${bgdRGB.bL})`); } const cellsToHighlight = this.findCellRefs(text); |
