SVG(Scalable Vector Graphics)λŠ” XML 기반의 벑터 κ·Έλž˜ν”½μ„ ν‘œν˜„ν•˜λŠ” 포맷으둜, μ›Ή νŽ˜μ΄μ§€λ‚˜ λ‹€λ₯Έ λ§€μ²΄μ—μ„œ μ‚¬μš©λ©λ‹ˆλ‹€. SVG의 fill 속성은 κ·Έλž˜ν”½ μš”μ†Œμ˜ 색상을 μ§€μ •ν•˜λŠ” 데 μ‚¬μš©λ©λ‹ˆλ‹€. μ—¬κΈ° λͺ‡ κ°€μ§€ fill μ†μ„±μ˜ μ˜ˆμ‹œκ°€ μžˆμŠ΅λ‹ˆλ‹€.

  1. κΈ°λ³Έ 색상 μ‚¬μš©:

    xml
    <svg width="100" height="100"> <rect width="100" height="100" fill="red" /> </svg>

    이 μ˜ˆμ œλŠ” 100x100 크기의 빨간색 μ‚¬κ°ν˜•μ„ μƒμ„±ν•©λ‹ˆλ‹€.

  2. RGB κ°’ μ‚¬μš©:

    xml
    <svg width="100" height="100"> <circle cx="50" cy="50" r="40" fill="rgb(0, 128, 255)" /> </svg>

    이 μ˜ˆμ œλŠ” 쀑심이 (50, 50)이고 λ°˜μ§€λ¦„μ΄ 40인 νŒŒλž€μƒ‰ 원을 μƒμ„±ν•©λ‹ˆλ‹€.

  3. 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인 녹색 타원을 μƒμ„±ν•©λ‹ˆλ‹€.

  4. λ¬΄μ§€κ°œ κ·ΈλΌλ°μ΄μ…˜ μ‚¬μš©:

    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 μš”μ†Œλ₯Ό μ‚¬μš©ν•˜μ—¬ μ •μ˜λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

  5. 무늬(νŒ¨ν„΄) μ‚¬μš©:

    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 속성을 ν™œμš©ν•˜μ—¬ λ‹€μ–‘ν•œ 색상 및 κ·Έλž˜ν”½ μŠ€νƒ€μΌμ„ μ μš©ν•˜λŠ” 방법을 λ³΄μ—¬μ€λ‹ˆλ‹€.