타원

Ellipse

가로와 세로 반지름을 따로 조절해 납작하거나 길쭉한 타원을 만듭니다.

다른 이름: EllipseOval

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

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

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

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

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

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

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

속성(props) · Ellipse

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

이름값기본값범위·선택지설명(원문)
originOrigin코드에서 지정center—Reference edge the center position is measured from (center default). Lets you pin the shape relative to a corner or the canvas centre.
colorColor#ffffff—Fill color of the ellipse
centerCenter
x0.5y0.5
{"x":0.5,"y":0.5}x, y: 0 – 1Center position of the ellipse
radiusXWidth0.350.01 – 1 (step 0.01)Horizontal semi-axis radius
radiusYHeight0.20.01 – 1 (step 0.01)Vertical semi-axis radius
rotationRotation00 – 360 (step 1)Rotation in degrees
softnessSoftness00 – 0.1 (step 0.001)Edge softness for antialiasing
strokeThicknessStroke Thickness00 – 0.2 (step 0.005)Stroke thickness. Zero means no stroke.
strokeColorStroke Color#000000—Color of the stroke outline
strokePositionStroke Positioncenteroutside · center · insidePosition of the stroke relative to the shape edge
colorSpaceColor Blendinglinearlinear · oklch · oklab · hsl · hsv · lchColor space for blending fill and stroke colors

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

타원은 원을 한쪽으로 눌러 늘린 듯한 도형입니다. 알약 모양의 장식이나 타원형 하이라이트처럼 원보다 방향감이 필요한 곳에 어울립니다.

`radiusX`와 `radiusY`는 각각 가로·세로 반지름이며 범위는 둘 다 0.01–1입니다. `rotation`은 0–360도 사이에서 타원의 방향을 바꾸고, `softness`는 0–0.1 범위에서 가장자리를 부드럽게 합니다.

가로와 세로 반지름이 같으면 원처럼 보이므로 길쭉한 비율이 필요할 때 두 값을 다르게 두세요. 배경 위에 겹치거나 여러 타원을 교차시키면 궤도·렌즈 같은 그래픽을 만들 수 있습니다.

언제 쓰나

타원형 버튼 장식, 빛 번짐의 바탕, 궤도나 렌즈 같은 그래픽에 좋습니다. 원과 다른 방향의 강조점을 만들 때도 쓸 수 있습니다. 모든 방향에서 반지름이 같아야 하면 피하고 Circle을 사용하세요.

페이지로 열기 ↗