Color Wheel

색상환 그라디언트

A directional gradient that cycles through rainbow colors or a custom set of three colors.

Also known as: ColorWheelRainbow gradient

Moves in browsers that support WebGPU

This device could not render the demo — showing a still

React
// Renders only in browsers with WebGPU.
import { Shader, ColorWheel } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <ColorWheel />
    </Shader>
  )
}
Vue
<!-- Renders only in browsers with WebGPU. -->
<script setup lang="ts">
import { Shader, ColorWheel } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <ColorWheel/>
  </Shader>
</template>
Svelte
<!-- Renders only in browsers with WebGPU. -->
<script>
  import { Shader, ColorWheel } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <ColorWheel />
</Shader>
Solid
// Renders only in browsers with WebGPU.
import { Shader, ColorWheel } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <ColorWheel />
    </Shader>
  )
}
JavaScript
// Renders only in browsers with WebGPU.
// expects <canvas id="canvas" style="width:100%;height:320px"></canvas> on the page
import { createShader } from 'shaders/js'

const shader = await createShader(document.getElementById("canvas"), {
  components: [
    {
      type: 'ColorWheel',
    }
  ]
}, { disableTelemetry: true })

Props · ColorWheel

Changes apply to the demo above and to the code tabs. Descriptions come from the library registry (MIT).

NameValueDefaultRange / optionsDescription
modeModerainbowrainbow · customRainbow cycles through the full spectrum; Custom loops through your three chosen colors
colorAColor 1#ff0000—First color in the cycle
colorBColor 2#00ff88—Second color in the cycle
colorCColor 3#0066ff—Third color in the cycle
scaleScale10.1 – 10 (step 0.1)Number of color cycles across the viewport
angleAngle0-180 – 180 (step 1)Direction the gradient flows
speedSpeed0.05-1 – 1 (step 0.01)Speed at which the gradient cycles
colorSpaceColor Spaceoklchlinear · oklch · oklab · hsl · hsv · lchColor space for blending between custom colors

Every component also takes blendMode · opacity · visible · maskSource/maskType · boundingBox · id

It resembles a color wheel stretched into a band: colors travel in one direction and cycle over time. It works well when color itself is the focus of a background or decoration.

Set `mode` to rainbow for the full spectrum, or custom to cycle through three chosen colors. Change `angle` to rotate the direction of the gradient (default 0°, range -180–180°). Increase `scale` to fit more color cycles across the viewport (default 1, range 0.1–10). `speed` controls the cycle rate (default 0.05, range -1–1).

This generator fills the canvas and needs no input beneath it. Small text can be hard to read over rapidly changing colors, so leave a nearly uniform area where text will sit. Check whether the color bands already provide enough emphasis before adding more decoration.

When to use

Use it to show a rainbow or custom color set, create a flowing color backdrop, or display a stretched color wheel. Avoid it in tight areas where text contrast matters.

Open as page ↗