육각 격자

Hex Grid

벌집처럼 육각형 칸이 이어지는 격자입니다.

다른 이름: HexGrid허니콤 격자

WebGPU 를 지원하는 브라우저에서 움직입니다

이 기기에서는 데모를 그리지 못해 정지 화면을 보여 줍니다

React
// WebGPU 를 지원하는 브라우저에서만 그립니다.
import { Shader, HexGrid } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <HexGrid />
    </Shader>
  )
}
Vue
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<script setup lang="ts">
import { Shader, HexGrid } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <HexGrid/>
  </Shader>
</template>
Svelte
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<script>
  import { Shader, HexGrid } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <HexGrid />
</Shader>
Solid
// WebGPU 를 지원하는 브라우저에서만 그립니다.
import { Shader, HexGrid } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <HexGrid />
    </Shader>
  )
}
JavaScript
// WebGPU 를 지원하는 브라우저에서만 그립니다.
// <canvas id="canvas" style="width:100%;height:320px"></canvas> 가 페이지에 있어야 한다
import { createShader } from 'shaders/js'

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

속성(props) · HexGrid

값을 바꾸면 위 데모와 코드 탭에 바로 반영됩니다. 설명은 라이브러리 레지스트리의 영어 원문(MIT)입니다.

이름값기본값범위·선택지설명(원문)
colorAColor A#000000—Cell fill color
colorBColor B#ffffff—Grid line color
cellsCells81 – 40 (step 1)Number of hexagons along the canvas height (the width fits as many as the aspect ratio allows)
thicknessThickness10 – 10 (step 0.1)Thickness of the hex grid lines
rotationRotation00 – 360 (step 1)Rotation of the grid in degrees
softnessSoftness00 – 1 (step 0.01)Softness of the line edges (0 = crisp, 1 = very soft)
variationVariation00 – 1 (step 0.01)Per-cell random lightening/darkening of the cell fill color
colorSpaceColor Spacelinearlinear · oklch · oklab · hsl · hsv · lchColor space for color interpolation

모든 컴포넌트 공통: blendMode · opacity · visible · maskSource/maskType · boundingBox · id

벌집이나 전략 게임의 전장처럼 육각형 칸이 화면을 채웁니다. 네모 칸과 다른 리듬을 주면서 각 셀의 경계를 또렷하게 보여 줍니다.

`cells`를 늘리면 육각형이 작고 촘촘해집니다. `colorA`는 칸, `colorB`는 선 색이며 `thickness`를 올리면 경계가 굵어집니다. `rotation`으로 격자의 방향을 바꿀 수 있습니다.

이 패턴은 자체적으로 화면을 채우므로 입력 레이어가 필요 없습니다. 지도나 데이터 배경에 쓸 때는 작은 셀을 너무 많이 두면 표시할 정보와 경계가 겹치므로, 셀 크기를 먼저 맞추세요.

언제 쓰나

전략 게임 지도, 네트워크·기술 테마의 배경, 벌집을 연상시키는 카드 장식에 어울립니다. 작은 셀이 정보나 글을 잘게 쪼개 보이게 하는 곳은 피하세요.

페이지로 열기 ↗