Solid Color

단색 배경

Fill the canvas with a single solid color.

Also known as: SolidColorFlat color

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, SolidColor } from 'shaders/react'

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

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

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

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <SolidColor />
    </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: 'SolidColor',
    }
  ]
}, { disableTelemetry: true })

Props · SolidColor

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

NameValueDefaultRange / optionsDescription
colorColor#5b18ca—The solid color to display

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

It is like laying one sheet of colored paper across the whole screen: there is no transition, just one chosen color. It makes a simple base that lets other layers stand out.

`color` sets the color that fills the canvas (default #5b18ca). Changing it changes the background everywhere; this component has no other controls.

As a solid-color generator, it needs no input beneath it. Check contrast before placing text or effects above it. If the screen needs several colors, compare it with a gradient or another generator; a plain field can make the foreground's color and shape easier to see.

When to use

Use it for a plain base color, to inspect an effect above it, or to make a strong foreground element stand out. Avoid it when the background itself needs color direction or motion.

Open as page ↗