getStrokeStyle static method

dynamic getStrokeStyle(
  1. dynamic width,
  2. dynamic color,
  3. dynamic lineJoin,
  4. dynamic lineCap,
  5. dynamic miterLimit,
)

Implementation

static getStrokeStyle(width, color, lineJoin, lineCap, miterLimit) {
  // Param width: Stroke width
  // Param color: As returned by three.Color.getStyle()
  // Param lineJoin: One of "round", "bevel", "miter" or "miter-limit"
  // Param lineCap: One of "round", "square" or "butt"
  // Param miterLimit: Maximum join length, in multiples of the "width" parameter (join is truncated if it exceeds that distance)
  // Returns style object

  width = width ?? 1;
  color = color ?? '#000';
  lineJoin = lineJoin ?? 'miter';
  lineCap = lineCap ?? 'butt';
  miterLimit = miterLimit ?? 4;

  return {
    "strokeColor": color,
    "strokeWidth": width,
    "strokeLineJoin": lineJoin,
    "strokeLineCap": lineCap,
    "strokeMiterLimit": miterLimit
  };
}