= {};
- if (!hollowCircle) {
- style.background = this.preprocessColor;
- if (isSameColorWithBackground(color)) {
- style.border = '0.5px solid var(--affine-border-color)';
- }
- }
+ const { color, preprocessColor, hollowCircle, letter } = this;
+ const additionIcon = AdditionIcon(preprocessColor, !!hollowCircle);
return html`
${additionIcon}
`;
}
+ @property({ attribute: true, type: Boolean })
+ accessor active: boolean = false;
+
@property({ attribute: false })
accessor color!: string;
- @property({ attribute: false })
- accessor hollowCircle: boolean | undefined = undefined;
+ @property({ attribute: 'hollow-circle', type: Boolean })
+ accessor hollowCircle: boolean = false;
@property({ attribute: false })
accessor letter: boolean | undefined = undefined;
@@ -213,8 +255,8 @@ export const colorContainerStyles = css`
display: flex;
align-items: center;
justify-content: center;
- width: 24px;
- height: 24px;
+ width: 27px;
+ height: 27px;
border-radius: 50%;
box-sizing: border-box;
overflow: hidden;
@@ -230,9 +272,9 @@ export const colorContainerStyles = css`
.color-container[active]:after {
position: absolute;
- width: 20px;
- height: 20px;
- border: 0.5px solid var(--affine-primary-color);
+ width: 27px;
+ height: 27px;
+ border: 1.5px solid var(--affine-primary-color);
border-radius: 50%;
box-sizing: border-box;
content: attr(data-letter);
@@ -274,22 +316,16 @@ export class EdgelessColorPanel extends LitElement {
${repeat(
this.palettes,
color => color,
- color => {
- const unit = ColorUnit(color, {
- hollowCircle: this.hollowCircle,
- letter: this.showLetterMark,
- });
-
- return html`
- this.onSelect(color)}
- >
- ${unit}
-
- `;
- }
+ color =>
+ html` this.onSelect(color)}
+ >
+ `
)}