고급 SVG 그라디언트와 패턴: 복잡한 효과 만들기
세련된 비주얼 효과를 위한 SVG 그라디언트와 패턴을 마스터하세요. 전문적인 디자인을 위한 선형, 방사형 그라디언트와 패턴 기법을 배웁니다.

Founder of VectoSolve
Self-taught developer, founder and sole developer of VectoSolve since 2024. He builds the conversion engine and the cutting, embroidery and 3D printing exports.
How this article was made: drafted with AI assistance, then edited and fact-checked before publication. About the author
Key Takeaways
- SVG는 선형 그라디언트, 방사형 그라디언트, 반복 타일 패턴을 지원합니다 — 모두 XML로 정의
- 투명도가 있는 다중 스톱 그라디언트로 부드러운 페이드, 스포트라이트, 글로우 효과 구현 가능
-
패턴은
patternUnits와patternTransform을 사용하여 타일링과 회전을 완전 제어 - 그라디언트를 패턴 안에 중첩하고 SMIL 또는 CSS로 애니메이션하여 다이나믹한 비주얼 구현
- 그라디언트 스톱을 제한하고 애니메이션 컨텍스트에서 복잡한 패턴을 피하여 최적화
단색을 넘어서
SVG 그라디언트와 패턴은 벡터 그래픽에 깊이와 시각적 흥미를 더합니다. 이 가이드에서는 전문적인 효과를 만들기 위한 고급 기법을 탐구합니다.
선형 그라디언트
기본 구조
<defs>
<linearGradient id="gradient1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" stop-color="#ff0000"/>
<stop offset="100%" stop-color="#0000ff"/>
</linearGradient>
</defs>
<rect fill="url(#gradient1)" width="200" height="100"/>
방향 제어
<!-- 수평 -->
<linearGradient x1="0%" y1="0%" x2="100%" y2="0%">
<!-- 수직 -->
<linearGradient x1="0%" y1="0%" x2="0%" y2="100%">
<!-- 대각선 -->
<linearGradient x1="0%" y1="0%" x2="100%" y2="100%">
<!-- 사용자 정의 각도 (45도) -->
<linearGradient gradientTransform="rotate(45)">
다중 스톱 그라디언트
<linearGradient id="rainbow">
<stop offset="0%" stop-color="#ff0000"/>
<stop offset="17%" stop-color="#ff8000"/>
<stop offset="33%" stop-color="#ffff00"/>
<stop offset="50%" stop-color="#00ff00"/>
<stop offset="67%" stop-color="#0000ff"/>
<stop offset="83%" stop-color="#4b0082"/>
<stop offset="100%" stop-color="#8f00ff"/>
</linearGradient>
Pro Tip: 각도 그라디언트에는 x1/y1/x2/y2를 수동으로 계산하는 대신 gradientTransform="rotate(45)"를 사용하세요. 더 읽기 쉽고 나중에 조정하기도 더 쉽습니다.
방사형 그라디언트
기본 방사형
<radialGradient id="radial1" cx="50%" cy="50%" r="50%">
<stop offset="0%" stop-color="#ffffff"/>
<stop offset="100%" stop-color="#000000"/>
</radialGradient>
오프셋 센터 (스포트라이트 효과)
<radialGradient id="spotlight"
cx="30%" cy="30%"
fx="25%" fy="25%"
r="50%">
<stop offset="0%" stop-color="#ffffff"/>
<stop offset="100%" stop-color="#333333"/>
</radialGradient>
타원형 그라디언트
<radialGradient id="ellipse"
cx="50%" cy="50%"
rx="50%" ry="25%">
<stop offset="0%" stop-color="#ff0000"/>
<stop offset="100%" stop-color="#000000"/>
</radialGradient>
A Full Year of Conversions for $49
Starter Annual: 25 conversions every month, $49 for the whole year. That is about $4.08 a month · Cancel anytime
Get the Annual Deal그라디언트 투명도
페이드 효과
<linearGradient id="fade-out">
<stop offset="0%" stop-color="#000000" stop-opacity="1"/>
<stop offset="100%" stop-color="#000000" stop-opacity="0"/>
</linearGradient>
투명 중심
<radialGradient id="glow">
<stop offset="0%" stop-color="#00ff00" stop-opacity="0.8"/>
<stop offset="50%" stop-color="#00ff00" stop-opacity="0.3"/>
<stop offset="100%" stop-color="#00ff00" stop-opacity="0"/>
</radialGradient>
"그라디언트와 패턴은 벡터 그래픽에서 플랫 디자인과 포토리얼리즘 사이의 다리입니다 — 적절하게 배치된 stop-opacity의 미묘함이 컴포지션을 좌우합니다.
패턴 기초
간단한 패턴
<defs>
<pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse">
<circle cx="10" cy="10" r="3" fill="#333"/>
</pattern>
</defs>
<rect fill="url(#dots)" width="200" height="200"/>
스트라이프 패턴
<pattern id="stripes" width="10" height="10" patternUnits="userSpaceOnUse">
<rect width="5" height="10" fill="#ff0000"/>
<rect x="5" width="5" height="10" fill="#ffffff"/>
</pattern>
복잡한 패턴
<pattern id="plaid" width="40" height="40" patternUnits="userSpaceOnUse">
<!-- 베이스 -->
<rect width="40" height="40" fill="#e0e0e0"/>
<!-- 수평 스트라이프 -->
<rect width="40" height="10" fill="#c0c0c0"/>
<rect y="20" width="40" height="10" fill="#c0c0c0"/>
<!-- 수직 스트라이프 -->
<rect width="10" height="40" fill="#a0a0a0" opacity="0.5"/>
<rect x="20" width="10" height="40" fill="#a0a0a0" opacity="0.5"/>
</pattern>
패턴 변환
회전 패턴
<pattern id="diagonal"
width="10" height="10"
patternTransform="rotate(45)"
patternUnits="userSpaceOnUse">
<line x1="0" y1="0" x2="0" y2="10" stroke="#000" stroke-width="2"/>
</pattern>
스케일링 패턴
<pattern id="scaled"
width="20" height="20"
patternTransform="scale(0.5)"
patternUnits="userSpaceOnUse">
<!-- 2x의 패턴 콘텐츠, 1x로 표시 -->
</pattern>
Free SVG Tools for Crafters
Design Checker · Color Separator · Mat Preview · Offset Generator · Text to SVG
Check Your SVG Free고급 기법
패턴 내 그라디언트
<defs>
<linearGradient id="grad">
<stop offset="0%" stop-color="#ff0000"/>
<stop offset="100%" stop-color="#00ff00"/>
</linearGradient>
<pattern id="gradient-dots" width="20" height="20" patternUnits="userSpaceOnUse">
<circle cx="10" cy="10" r="8" fill="url(#grad)"/>
</pattern>
</defs>
그라디언트 배경의 패턴
<defs>
<radialGradient id="bg-grad">
<stop offset="0%" stop-color="#ffffff"/>
<stop offset="100%" stop-color="#cccccc"/>
</radialGradient>
<pattern id="textured" width="4" height="4" patternUnits="userSpaceOnUse">
<rect width="4" height="4" fill="url(#bg-grad)"/>
<circle cx="2" cy="2" r="1" fill="#000" opacity="0.1"/>
</pattern>
</defs>
노이즈/그레인 효과
<filter id="noise">
<feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4"/>
<feColorMatrix type="saturate" values="0"/>
</filter>
<rect filter="url(#noise)" opacity="0.1" width="100%" height="100%"/>
그라디언트와 CSS 애니메이션
애니메이션 그라디언트
<svg>
<defs>
<linearGradient id="animated-grad" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" stop-color="#ff0000">
<animate attributeName="stop-color"
values="#ff0000;#00ff00;#0000ff;#ff0000"
dur="4s" repeatCount="indefinite"/>
</stop>
<stop offset="100%" stop-color="#0000ff">
<animate attributeName="stop-color"
values="#0000ff;#ff0000;#00ff00;#0000ff"
dur="4s" repeatCount="indefinite"/>
</stop>
</linearGradient>
</defs>
</svg>
SMIL (<animate>)을 통한 애니메이션 그라디언트는 JavaScript 없이 모든 최신 브라우저에서 네이티브로 작동합니다. 더 복잡한 그라디언트 애니메이션 — 시간에 따른 스톱 위치 이동 등 — 에는 SMIL과 부모 요소의 CSS 트랜지션을 결합하세요.
성능 고려사항
최적화 팁
- 그라디언트 스톱을 제한하세요
- 애니메이션에서 복잡한 패턴을 피하세요
- will-change를 적게 사용하세요
- 폴백 색상을 고려하세요
- 모바일 기기에서 테스트하세요
래스터화할 때
다음의 경우 래스터화를 고려하세요:
- 매우 복잡한 패턴
- 무거운 필터 효과
- 성능이 중요한 애플리케이션
- 정적 그래픽
A Full Year of Conversions for $49
Starter Annual: 25 conversions every month, $49 for the whole year. That is about $4.08 a month · Cancel anytime
Get the Annual DealVectoSolve와 그라디언트
그라디언트 처리
VectoSolve는 그라디언트 변환을 처리합니다:
- 그라디언트 색상 추출
- 색상 스톱 보존
- 깔끔한 SVG 출력
변환 후 그라디언트 작업
벡터화 후:
- 추출된 그라디언트 확인
- 필요시 스톱 조정
- 사용 사례에 맞게 최적화
- 패턴을 수동으로 추가
결론
SVG 그라디언트와 패턴은 래스터 제한 없이 세련된 비주얼 효과를 구현합니다. 벡터 그래픽에 깊이, 텍스처, 시각적 흥미를 만들기 위해 이 기법들을 마스터하세요. VectoSolve의 깨끗한 벡터로 시작한 후 필요에 따라 그라디언트와 패턴으로 향상시키세요.
| 그라디언트/패턴 유형 | SVG 요소 | 일반적인 사용 사례 |
|---|---|---|
| 선형 그라디언트 | <linearGradient> | 배경, 버튼, 하늘 효과 |
| 방사형 그라디언트 | <radialGradient> | 스포트라이트, 글로우, 원형 페이드 |
| 반복 패턴 | <pattern> | 텍스처, 직물, 타일링 배경 |
| 메시 그라디언트 | <meshGradient> (SVG2) | 포토리얼 색상 블렌딩 |
출처 및 추가 읽기
- MDN Web Docs: SVG Gradients — linearGradient, radialGradient, pattern 요소에 대한 포괄적 레퍼런스
- W3C SVG 2: Paint Servers — SVG 그라디언트, 패턴, 메시 그라디언트에 대한 공식 사양
- CSS-Tricks: SVG Gradients — SVG 그라디언트와 패턴 생성 및 애니메이션에 대한 비주얼 튜토리얼
- Smashing Magazine: Advanced SVG — 패턴 변환과 그라디언트 컴포지션에 대한 심층 기술 기사