aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PropertiesView.tsx
diff options
context:
space:
mode:
authorSophie Zhang <sophie_zhang@brown.edu>2023-11-16 01:30:42 -0500
committerSophie Zhang <sophie_zhang@brown.edu>2023-11-16 01:30:42 -0500
commit6a4de8d05ce46dc29ac69f696c419a57e604f516 (patch)
treec0368c0df9dec2a6f2835707681c215aae448e71 /src/client/views/PropertiesView.tsx
parent953627770c09cbb6918a0816f4e5974bb57044e1 (diff)
sorting?
Diffstat (limited to 'src/client/views/PropertiesView.tsx')
-rw-r--r--src/client/views/PropertiesView.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index fb2d811f4..86784d467 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -41,6 +41,7 @@ import './PropertiesView.scss';
import { DefaultStyleProvider } from './StyleProvider';
import { FaFillDrip } from 'react-icons/fa';
import { GeneratedResponse } from '../apis/gpt/customization';
+import { ExtractColors } from './ExtractColors';
const _global = (window /* browser */ || global) /* node */ as any;
interface PropertiesViewProps {
@@ -1191,8 +1192,8 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
? this.generatedStyles.map((style, i) => (
<div className="propertiesView-palette" style={{ display: 'flex', gap: '4px', backgroundColor: this.selectedStyle === i ? StrCast(Doc.UserDoc().userVariantColor) : '#00000000' }} onClick={() => this.styleCollection(i)}>
<div style={{ width: '24px', height: '24px', backgroundColor: style.collectionBackgroundColor, borderRadius: '2px' }}></div>
- {style.documentsWithColors.map(c => (
- <div style={{ width: '24px', height: '24px', backgroundColor: c.color, borderRadius: '2px' }}></div>
+ {ExtractColors.sortColors(style.documentsWithColors.map(doc => ExtractColors.hexToFinalColor(doc.color))).map(c => (
+ <div style={{ width: '24px', height: '24px', backgroundColor: c.hex, borderRadius: '2px' }}></div>
))}
</div>
))