Skip to content

Commit

Permalink
fix(style): Update the defaultStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerwin-L committed Nov 21, 2022
1 parent 33c28d5 commit 892bb93
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/lb-annotation/src/constant/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,5 @@ export const FILTER_TOOL_COLOR = {
[EFilterToolOperation.clc]: 'rgba(46, 230, 46, 1)',
[EFilterToolOperation.crc]: 'rgba(255, 51, 51, 1)',
};

export const styleString = `{"color":1,"width":2,"borderOpacity":9,"fillOpacity":9,"toolColor":{"1":{"valid":{"stroke":"rgba(0,0,255,0.50)","fill":"rgba(0,0,255,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validSelected":{"stroke":"rgba(0,15,255,1.00)","fill":"rgba(0,15,255,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,0.80)","fill":"rgba(255,153,102,0.19)"},"validHover":{"stroke":"rgba(0,15,255,0.80)","fill":"rgba(0,15,255,0.51)"},"invalidHover":{"stroke":"rgba(255,153,102,0.50)","fill":"rgba(255,153,102,0.32)"}},"3":{"valid":{"stroke":"rgba(0,255,255,0.50)","fill":"rgba(0,255,255,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validSelected":{"stroke":"rgba(0,212,255,1.00)","fill":"rgba(0,212,255,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,0.80)","fill":"rgba(255,153,102,0.19)"},"validHover":{"stroke":"rgba(0,212,255,0.80)","fill":"rgba(0,212,255,0.51)"},"invalidHover":{"stroke":"rgba(255,153,102,0.50)","fill":"rgba(255,153,102,0.32)"}},"5":{"valid":{"stroke":"rgba(0,255,0,0.50)","fill":"rgba(0,255,0,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validSelected":{"stroke":"rgba(149,255,1.00)","fill":"rgba(149,255,0,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,0.80)","fill":"rgba(255,153,102,0.19)"},"validHover":{"stroke":"rgba(149,255,0,0.80)","fill":"rgba(149,255,0,0.51)"},"invalidHover":{"stroke":"rgba(255,153,102,0.50)","fill":"rgba(255,153,102,0.32)"}},"7":{"valid":{"stroke":"rgba(255,255,0,0.50)","fill":"rgba(255,255,0,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validSelected":{"stroke":"rgba(255,230,102,1.00)","fill":"rgba(255,213,0,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,0.80)","fill":"rgba(255,153,102,0.19)"},"validHover":{"stroke":"rgba(255,230,102,0.80)","fill":"rgba(255,230,102,0.51)"},"invalidHover":{"stroke":"rgba(255,153,102,0.50)","fill":"rgba(255,153,102,0.32)"}},"9":{"valid":{"stroke":"rgba(255,0,255,0.50)","fill":"rgba(255,0,255,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validSelected":{"stroke":"rgba(230,102,255,1.00)","fill":"rgba(213,0,255,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,0.80)","fill":"rgba(255,153,102,0.19)"},"validHover":{"stroke":"rgba(230,102,255,0.80)","fill":"rgba(230,102,255,0.51)"},"invalidHover":{"stroke":"rgba(255,153,102,0.50)","fill":"rgba(255,153,102,0.32)"}}},"attributeColor":[{"valid":{"stroke":"rgba(204,204,204,1.00)","fill":"rgba(204,204,204,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.32)"},"validSelected":{"stroke":"rgba(204,204,204,1.00)","fill":"rgba(204,204,204,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validHover":{"stroke":"rgba(204,204,204,1.00)","fill":"rgba(204,204,204,0.64)"},"invalidHover":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"}},{"valid":{"stroke":"rgba(128,12,249,1.00)","fill":"rgba(128,12,249,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.32)"},"validSelected":{"stroke":"rgba(128,12,249,1.00)","fill":"rgba(128,12,249,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validHover":{"stroke":"rgba(128,12,249,1.00)","fill":"rgba(128,12,249,0.64)"},"invalidHover":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"}},{"valid":{"stroke":"rgba(0,255,48,1.00)","fill":"rgba(0,255,48,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.32)"},"validSelected":{"stroke":"rgba(0,255,48,1.00)","fill":"rgba(0,255,48,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validHover":{"stroke":"rgba(0,255,48,1.00)","fill":"rgba(0,255,48,0.64)"},"invalidHover":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"}},{"valid":{"stroke":"rgba(255,136,247,1.00)","fill":"rgba(255,136,247,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.32)"},"validSelected":{"stroke":"rgba(255,136,247,1.00)","fill":"rgba(255,136,247,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validHover":{"stroke":"rgba(255,136,247,1.00)","fill":"rgba(255,136,247,0.64)"},"invalidHover":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"}},{"valid":{"stroke":"rgba(255,226,50,1.00)","fill":"rgba(255,226,50,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.32)"},"validSelected":{"stroke":"rgba(255,226,50,1.00)","fill":"rgba(255,226,50,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validHover":{"stroke":"rgba(255,226,50,1.00)","fill":"rgba(255,226,50,0.64)"},"invalidHover":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"}},{"valid":{"stroke":"rgba(153,66,23,1.00)","fill":"rgba(153,66,23,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.32)"},"validSelected":{"stroke":"rgba(153,66,23,1.00)","fill":"rgba(153,66,23,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validHover":{"stroke":"rgba(153,66,23,1.00)","fill":"rgba(153,66,23,0.64)"},"invalidHover":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"}},{"valid":{"stroke":"rgba(2,130,250,1.00)","fill":"rgba(2,130,250,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.32)"},"validSelected":{"stroke":"rgba(2,130,250,1.00)","fill":"rgba(2,130,250,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validHover":{"stroke":"rgba(2,130,250,1.00)","fill":"rgba(2,130,250,0.64)"},"invalidHover":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"}},{"valid":{"stroke":"rgba(255,35,35,1.00)","fill":"rgba(255,35,35,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.32)"},"validSelected":{"stroke":"rgba(255,35,35,1.00)","fill":"rgba(255,35,35,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validHover":{"stroke":"rgba(255,35,35,1.00)","fill":"rgba(255,35,35,0.64)"},"invalidHover":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"}},{"valid":{"stroke":"rgba(0,255,234,1.00)","fill":"rgba(0,255,234,0.32)"},"invalid":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.32)"},"validSelected":{"stroke":"rgba(0,255,234,1.00)","fill":"rgba(0,255,234,0.64)"},"invalidSelected":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"},"validHover":{"stroke":"rgba(0,255,234,1.00)","fill":"rgba(0,255,234,0.64)"},"invalidHover":{"stroke":"rgba(255,153,102,1.00)","fill":"rgba(255,153,102,0.64)"}}],"lineColor":{"1":"rgba(102, 111, 255, 1 )","3":"rgba(102, 230, 255, 1)","5":"rgba(191, 255, 102, 1)","7":"rgba(255, 230, 102, 1)","9":"rgba(230, 102, 255, 1)"},"attributeLineColor":["rgba(204, 204, 204, 1)","rgba(128, 12, 249, 1)","rgba(0, 255, 48, 1)","rgba(255, 136, 247, 1)","rgba(255, 226, 50, 1)","rgba(153, 66, 23, 1)","rgba(2, 130, 250, 1)","rgba(255, 35, 35, 1)","rgba(0, 255, 234, 1)"]}`;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import CommonToolUtils from '@/utils/tool/CommonToolUtils';
import LineToolUtils from '@/utils/tool/LineToolUtils';
import { EDragStatus, EGrowthMode, ELang } from '../../constant/annotation';
import EKeyCode from '../../constant/keyCode';
import { BASE_ICON, COLORS_ARRAY } from '../../constant/style';
import { BASE_ICON, COLORS_ARRAY, styleString } from '../../constant/style';
import locale from '../../locales';
import { EMessage } from '../../locales/constants';
import ActionsHistory from '../../utils/ActionsHistory';
Expand Down Expand Up @@ -204,7 +204,7 @@ class BasicToolOperation extends EventListener {
};
this.attributeLockList = [];
this.history = new ActionsHistory();
this.style = props.style ?? {};
this.style = props.style ?? CommonToolUtils.jsonParser(styleString);
this._imgAttribute = props.imgAttribute ?? {};
this.isHidden = false;
this.dragStatus = EDragStatus.Wait;
Expand Down
Loading

0 comments on commit 892bb93

Please sign in to comment.