heatmap

A glowing animated gradient flowing through any silhouette. Up to ten palette colors, controllable wave direction and noise.

Preview

live
Upload your own silhouette or logo (SVG / PNG with transparency works best).

Install

npm
npm i @devmischief/shaders-svelte

Code

import { Heatmap } from '@devmischief/shaders-svelte';

<Heatmap
  width={1280}
  height={720}
  colors={['#112069', '#1f3ca3', '#3265e7', '#6bd8ff', '#ffe77a', '#ff9a1f', '#ff4d00']}
  colorBack="#000000"
  contour={0.5}
  angle={0}
  noise={0}
  innerGlow={0.5}
  outerGlow={0.5}
  scale={0.75}
  rotation={0}
  offsetX={0}
  offsetY={0}
  speed={1}
  fit="contain"
/>
			
			

Shader Props

10
namedescriptiontypevalues
imageSource image used as the heat shape. Silhouettes and logos work best.stringurl
colorsHeatmap gradient colors (up to 10).string[]hex / rgb
colorBackBackground color shown behind the shape.stringhex / rgba
contourHeat intensity near the edges of the shape.number0 → 1
angleDirection of the flowing heatwaves.number0 → 360°
noiseGrain applied across the entire graphic.number0 → 1
innerGlowSize of the heated area inside the shape.number0 → 1
outerGlowSize of the heated area outside the shape.number0 → 1
speedAnimation speed of the heatwaves.number0 → 3
fitHow the source image is fit into the canvas.stringcover · contain

Common Props

8
namedescriptiontypevalues
scaleOverall zoom level of the graphics.number0.01 → 4
rotationOverall rotation angle of the graphics.number0 → 360
offsetXHorizontal offset of the graphics.number−1 → 1
offsetYVertical offset of the graphics.number−1 → 1
originXReference point for positioning width in the canvas.number0 → 1
originYReference point for positioning height in the canvas.number0 → 1
minPixelRatioMinimum pixel ratio used when rendering the shader (default 2).number
maxPixelCountMaximum pixel count the shader may process.number

built with mischief by devmischief

@devmischief/shaders-svelte