color panels

Pseudo-3D semi-transparent panels rotating around a central axis. Skew, blur, and fade for kaleidoscope, glass-slat, and prism looks.

Preview

live

Install

npm
npm i @devmischief/shaders-svelte

Code

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

<ColorPanels
  width={1280}
  height={720}
  colors={['#ff006e', '#3a86ff', '#06d6a0', '#ffbe0b']}
  colorBack="#000000"
  density={3}
  angle1={0}
  angle2={0}
  length={1.1}
  edges={true}
  blur={0}
  fadeIn={1}
  fadeOut={0.3}
  gradient={0}
  scale={0.8}
  rotation={0}
  offsetX={0}
  offsetY={0}
  speed={0.5}
  fit="contain"
/>
			
			

Shader Props

13
namedescriptiontypevalues
colorsPanel colors (up to 7).string[]hex / rgb
colorBackBackground color shown behind the panels.stringhex / rgba
densityAngle between every two panels.number0.25 → 7
angle1First skew angle applied to all panels.number−1 → 1
angle2Second skew angle applied to all panels.number−1 → 1
lengthPanel length relative to total height.number0 → 3
edgesColor highlight along the panel edges.booleantrue · false
blurSide blur. 0 = sharp edges.number0 → 0.5
fadeInTransparency near the central axis.number0 → 1
fadeOutTransparency near the viewer.number0 → 1
gradientColor mixing within a panel. 0 = solid, 1 = gradient.number0 → 1
speedRotation speed of the panels.number0 → 3
fitHow the panels world is fit into the canvas.stringnone · cover · contain

Common Props

6
namedescriptiontypevalues
originXReference point for positioning width in the canvas.number0 → 1
originYReference point for positioning height in the canvas.number0 → 1
worldWidthVirtual width of the graphic before it's scaled to fit the canvas.number
worldHeightVirtual height of the graphic before it's scaled to fit the canvas.number
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