/** * Created by luosong on 16/7/8. */ const color = require('onecolor'); const DefaultSelectionColor = color('rgb(56, 109, 255)'); const SnapLineColor = color('magenta'); const LockSelectionColor = color('rgb(200, 200, 200)'); const OverlappedColor = color('rgb(229, 93, 93)'); let SelectionPen = null; let SelectionBrush = null; let SelectionPenHalf = null; let SelectionBrushHalf = null; export class DesignerStyleSettings { static SnapGridColor = color('rgb(212, 208, 200)'); static SnapLineBaseLinePen = {stroke:'magenta', strokeWidth: 1}; static SnapLineNormalPen = {stroke:SnapLineColor.cssa(), strokeWidth: 1}; static SnapLinePaddingBrush = {fill:SnapLineColor.alpha(64/255.0).cssa()}; static TextBackgroundBrush = {fill:'rgba(255, 255, 255, 1)'}; static DimensionFont = {fontSize:8}; static SelectionBorderSize = 1; static SelectionBorderHitArea = 4; static HandleSize = 5; // 小爪子抓柄的大小 static FloatEpsilon = 0.01; static get SelectionColor() { return DefaultSelectionColor; } static get SelectionPen():any { if (! SelectionPen) { SelectionPen = {stroke: DesignerStyleSettings.SelectionColor.cssa(), strokeWidth: 1}; } return SelectionPen; } static get SelectionPenHalf():any { if (! SelectionPenHalf) { SelectionPenHalf = {stroke: DesignerStyleSettings.SelectionHalfColor.cssa(), strokeWidth: 1}; } return SelectionPenHalf; } static get SelectionBrush():any { if (! SelectionBrush) { SelectionBrush = {fill: DesignerStyleSettings.SelectionColor.cssa()}; } return SelectionBrush; } static get SelectionBrushHalf():any { if (! SelectionBrushHalf) { SelectionBrushHalf = {fill: DesignerStyleSettings.SelectionHalfColor.cssa()}; } return SelectionBrushHalf; } static get SelectionHalfColor() { return DesignerStyleSettings.SelectionColor; //.alpha(180/255.0); } static get SelectionLockColor() { return LockSelectionColor; } static get OverlappedColor() { return OverlappedColor } }