All files / src/apps/tile-editor draw-config.ts

0% Statements 0/103
100% Branches 1/1
100% Functions 1/1
0% Lines 0/103

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106                                                                                                                                                                                                                   
export type LetterSegments = Array<[number, number, number, number]>;
 
export const DRAW_CONFIG = {
  backgroundColor: '#1a1a1a',
  defaultScale: 100,
  editorControls: {
    scale: { min: 1, max: 200 },
    numSides: { min: 3, max: 12, step: 1 },
    edgeWidth: { min: 1, max: 12, step: 1 },
    axesLineWidth: { min: 1, max: 6, step: 1 },
    closedPolygonEpsilon: { min: 1e-6, max: 1e-2, step: 1e-6 },
  },
  defaultEdgeWidth: 2,
  defaultAxesColor: '#444444',
  defaultAxesLineWidth: 1,
  defaultClosedPolygonEpsilon: 1e-4,
  axesEndpoints: {
    x: { x: 1, y: 0 },
    y: { x: 0, y: 1 },
  },
  dashAnimationSpeed: 0.4,
  polygonFillAlpha: 0.8,
  polygonFillColors: {
    hover: 0x4a9eff,
    error: 0x661111,
    normal: 0x444444,
  },
  polygonStrokeColors: {
    error: 0xff4d4d,
    closed: 0xffffff,
    hover: 0xffd24d,
  },
  selectionStrokeColors: {
    primary: 0x000000,
    secondary: 0xffffff,
  },
  hoverVertex: {
    color: 0xffd24d,
    radiusPx: 6,
    minWorld: 0.08,
    toleranceScale: 1.6,
  },
  hoverEdge: {
    color: 0xffd24d,
    widthFactor: 3,
    minPx: 2,
  },
  labelColor: 0xffd24d,
  labelFontSizePx: 12,
  labelStrokeMinPx: 1,
  labelStrokeScale: 0.12,
  axisLabelOffsets: {
    x: { dx: 0.2, dy: -0.6 },
    y: { dx: -0.6, dy: -1.2 },
  },
  vertexLabelCenterOffset: 0.5,
  dottedDash: {
    widthFactor: 2,
    minPx: 4,
  },
  dashedDash: {
    widthFactor: 3,
    minPx: 6,
  },
  dashToggleEpsilon: 1e-6,
  letterGlyphs: {
    A: [[0,1,0,0],[1,1,1,0],[0,0,1,0],[0,0.5,1,0.5]],
    B: [
      [0,0,0,1],
      [0,0,0.7,0],
      [0.7,0,0.85,0.2],
      [0.85,0.2,0.85,0.4],
      [0.85,0.4,0.7,0.5],
      [0.7,0.5,0,0.5],
      [0.7,0.5,0.85,0.6],
      [0.85,0.6,0.85,0.85],
      [0.85,0.85,0.7,1],
      [0.7,1,0,1],
    ],
    C: [[1,0,0,0],[0,0,0,1],[0,1,1,1]],
    D: [[0,0,0,1],[0,0,0.75,0],[0.75,0,1,0.2],[1,0.2,1,0.8],[1,0.8,0.75,1],[0.75,1,0,1]],
    E: [[1,0,0,0],[0,0,0,1],[0,0.5,0.8,0.5],[0,1,1,1]],
    F: [[0,0,0,1],[0,0,1,0],[0,0.5,0.8,0.5]],
    G: [[1,0,0,0],[0,0,0,1],[0,1,1,1],[1,1,1,0.6],[1,0.6,0.6,0.6]],
    H: [[0,0,0,1],[1,0,1,1],[0,0.5,1,0.5]],
    I: [[0,0,1,0],[0.5,0,0.5,1],[0,1,1,1]],
    J: [[1,0,1,1],[1,1,0,1],[0,1,0,0.7]],
    K: [[0,0,0,1],[0,0.5,1,0],[0,0.5,1,1]],
    L: [[0,0,0,1],[0,1,1,1]],
    M: [[0,1,0,0],[1,1,1,0],[0,0,0.5,0.5],[0.5,0.5,1,0]],
    N: [[0,1,0,0],[1,1,1,0],[0,0,1,1]],
    O: [[0,0,1,0],[1,0,1,1],[1,1,0,1],[0,1,0,0]],
    P: [[0,0,0,1],[0,0,1,0],[1,0,1,0.5],[1,0.5,0,0.5]],
    Q: [[0,0,1,0],[1,0,1,1],[1,1,0,1],[0,1,0,0],[0.6,0.6,1,1]],
    R: [[0,0,0,1],[0,0,1,0],[1,0,1,0.5],[1,0.5,0,0.5],[0,0.5,1,1]],
    S: [[1,0,0,0],[0,0,0,0.5],[0,0.5,1,0.5],[1,0.5,1,1],[1,1,0,1]],
    T: [[0,0,1,0],[0.5,0,0.5,1]],
    U: [[0,0,0,1],[0,1,1,1],[1,1,1,0]],
    V: [[0,0,0.5,1],[0.5,1,1,0]],
    W: [[0,0,0.25,1],[0.25,1,0.5,0.5],[0.5,0.5,0.75,1],[0.75,1,1,0]],
    X: [[0,0,1,1],[1,0,0,1]],
    Y: [[0,0,0.5,0.5],[1,0,0.5,0.5],[0.5,0.5,0.5,1]],
    Z: [[0,0,1,0],[1,0,0,1],[0,1,1,1]],
  } as Record<string, LetterSegments>,
};