Diagram accents

Cobalt Shard

Five nodes at a low Randomness value give an angular, splintered outline stroked in deep blue.

outlineirregularboldcool

Download

SVG file

Seed 6060 · 5 nodes · randomness 4

Code

Copy the code.

SVG markup
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500" width="100%"><path d="M337,300.5Q283,351,187,358Q91,365,115.5,267.5Q140,170,233.5,91.5Q327,13,359,131.5Q391,250,337,300.5Z" fill="none" stroke="#0668b6" stroke-width="7"/></svg>
CSS clip-path
.blob {
  width: 500px;
  height: 500px;
  clip-path: path("M337,300.5Q283,351,187,358Q91,365,115.5,267.5Q140,170,233.5,91.5Q327,13,359,131.5Q391,250,337,300.5Z");
}
React component
/**
 * Blob — generated by blobs.app.
 *
 * Drop this file into your project and render <Blob /> anywhere.
 */
import { useId } from 'react';

export interface BlobProps {
  /** Rendered width and height. A number is treated as px. Defaults to 100%. */
  size?: number | string;
  /** Class name for the root svg element. */
  className?: string;
  /** Accessible name. Without it the graphic is hidden from assistive tech. */
  title?: string;
}

export function Blob({ size = '100%', className, title }: BlobProps) {
  // Unique per instance, so two blobs on one page never share a def id.
  const uid = useId().replace(/[^a-zA-Z0-9]/g, '');
  const titleId = `blob-title-${uid}`;

  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 500 500"
      width={size}
      height={size}
      className={className}
      role={title ? 'img' : undefined}
      aria-labelledby={title ? titleId : undefined}
      aria-hidden={title ? undefined : true}
    >
      {title ? <title id={titleId}>{title}</title> : null}
      <path
        d="M337,300.5Q283,351,187,358Q91,365,115.5,267.5Q140,170,233.5,91.5Q327,13,359,131.5Q391,250,337,300.5Z"
        fill="none"
        stroke="#0668b6"
        strokeWidth={7}
      />
    </svg>
  );
}

export default Blob;
Flutter painter
// Generated by blobs.app.
//
// Paint the blob:
//   CustomPaint(painter: BlobPainter(), size: const Size(300, 300))
//
// Or clip a widget to it:
//   ClipPath(clipper: BlobClipper(), child: child)

import 'dart:ui' as ui;

import 'package:flutter/material.dart';

/// The blob outline, scaled from its 500x500 design space to [size].
Path buildBlobPath(Size size) {
  final double sx = size.width / 500.0;
  final double sy = size.height / 500.0;
  final Path path = Path();
  path.moveTo(337.0 * sx, 300.5 * sy);
  path.quadraticBezierTo(283.0 * sx, 351.0 * sy, 187.0 * sx, 358.0 * sy);
  path.quadraticBezierTo(91.0 * sx, 365.0 * sy, 115.5 * sx, 267.5 * sy);
  path.quadraticBezierTo(140.0 * sx, 170.0 * sy, 233.5 * sx, 91.5 * sy);
  path.quadraticBezierTo(327.0 * sx, 13.0 * sy, 359.0 * sx, 131.5 * sy);
  path.quadraticBezierTo(391.0 * sx, 250.0 * sy, 337.0 * sx, 300.5 * sy);
  path.close();
  return path;
}

class BlobPainter extends CustomPainter {
  const BlobPainter();

  @override
  void paint(Canvas canvas, Size size) {
    final Path path = buildBlobPath(size);
    final Paint paint = Paint()
      ..isAntiAlias = true
      ..color = const Color(0xFF0668B6)
      ..style = PaintingStyle.stroke
      ..strokeWidth = 7.0 * (size.width / 500.0);
    canvas.drawPath(path, paint);
  }

  @override
  bool shouldRepaint(covariant BlobPainter oldDelegate) => false;
}

/// Clips any widget to the same shape: ClipPath(clipper: BlobClipper(), ...).
class BlobClipper extends CustomClipper<Path> {
  const BlobClipper();

  @override
  Path getClip(Size size) => buildBlobPath(size);

  @override
  bool shouldReclip(covariant CustomClipper<Path> oldClipper) => false;
}

Shapes

Shapes like this one