SVG(Scalable Vector Graphics)λ XML κΈ°λ°μ λ²‘ν° κ·Έλν½μ νννλ ν¬λ§·μΌλ‘, μΉ νμ΄μ§λ λ€λ₯Έ 맀체μμ μ¬μ©λ©λλ€. SVGμ fill
μμ±μ κ·Έλν½ μμμ μμμ μ§μ νλ λ° μ¬μ©λ©λλ€. μ¬κΈ° λͺ κ°μ§ fill
μμ±μ μμκ° μμ΅λλ€.
κΈ°λ³Έ μμ μ¬μ©:
xml<svg width="100" height="100">
<rect width="100" height="100" fill="red" />
</svg>
μ΄ μμ λ 100x100 ν¬κΈ°μ λΉ¨κ°μ μ¬κ°νμ μμ±ν©λλ€.
RGB κ° μ¬μ©:
xml<svg width="100" height="100">
<circle cx="50" cy="50" r="40" fill="rgb(0, 128, 255)" />
</svg>
μ΄ μμ λ μ€μ¬μ΄ (50, 50)μ΄κ³ λ°μ§λ¦μ΄ 40μΈ νλμ μμ μμ±ν©λλ€.
HEX μ½λ μ¬μ©:
xml<svg width="100" height="100">
<ellipse cx="50" cy="50" rx="40" ry="20" fill="#00ff00" />
</svg>
μ΄ μμ λ μ€μ¬μ΄ (50, 50)μ΄κ³ xμΆ λ°μ§λ¦μ΄ 40, yμΆ λ°μ§λ¦μ΄ 20μΈ λ Ήμ νμμ μμ±ν©λλ€.
무μ§κ° κ·ΈλΌλ°μ΄μ μ¬μ©:
xml<svg width="200" height="100">
<rect width="200" height="100" fill="url(#rainbow)" />
<linearGradient id="rainbow" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style="stop-color: red" />
<stop offset="20%" style="stop-color: orange" />
<stop offset="40%" style="stop-color: yellow" />
<stop offset="60%" style="stop-color: green" />
<stop offset="80%" style="stop-color: blue" />
<stop offset="100%" style="stop-color: violet" />
</linearGradient>
</svg>
μ΄ μμ λ 무μ§κ° κ·ΈλΌλ°μ΄μ
μΌλ‘ μ±μμ§ μ¬κ°νμ μμ±ν©λλ€. κ·ΈλΌλ°μ΄μ
μ linearGradient
μμλ₯Ό μ¬μ©νμ¬ μ μλμμ΅λλ€.
무λ¬(ν¨ν΄) μ¬μ©:
xml<svg width="100" height="100">
<rect width="100" height="100" fill="url(#pattern)" />
<defs>
<pattern id="pattern" width="20" height="20" patternUnits="userSpaceOnUse">
<rect width="10" height="10" fill="white" />
<rect x="10" y="10" width="10" height="10" fill="black" />
</pattern>
</defs>
</svg>
μ΄ μμ λ 체μ€ν 무λ¬λ‘ μ±μμ§ μ¬κ°νμ μμ±ν©λλ€. 무λ¬λ pattern
μμλ₯Ό μ¬μ©νμ¬ μ μλμμ΅λλ€.
μ΄λ¬ν μμλ€μ SVGμ fill
μμ±μ νμ©νμ¬ λ€μν μμ λ° κ·Έλν½ μ€νμΌμ μ μ©νλ λ°©λ²μ 보μ¬μ€λλ€.