2010-08-07 5 views
10

SVG linear gradient http://elv1s.ru/files/svg/gradient-hue.pngĐộ dốc tuyến tính SVG từ hue 0 đến 360

Cách thích hợp để tạo độ dốc như thế này là gì? Tôi cố gắng this SVG:

<linearGradient id="hue" x1="0" y1="1" x2="0" y2="0"> 
    <stop offset="0%" stop-color="#ff0000"/> 
    <stop offset="17%" stop-color="#ffff00"/> 
    <stop offset="34%" stop-color="#00ff00"/> 
    <stop offset="50%" stop-color="#00ffff"/> 
    <stop offset="66%" stop-color="#0000ff"/> 
    <stop offset="82%" stop-color="#ff00ff"/> 
    <stop offset="100%" stop-color="#ff0000"/> 
</linearGradient>

Nó hoạt động, nhưng vẫn không đủ tốt:

SVG linear gradient http://elv1s.ru/files/svg/gradient-hue-reference.png

tôi có thể thấy sự khác biệt giữa hai gradient. Có cách nào tốt hơn để làm điều đó?

Trả lời

0
<linearGradient 
    id="linearGradient3706"> 
    <stop 
    style="stop-color:#ff1c1c;stop-opacity:1;" 
    offset="0" 
    id="stop3708" /> 
    <stop 
    id="stop3728" 
    offset="0.16105497" 
    style="stop-color:#fd00ca;stop-opacity:1;" /> 
    <stop 
    id="stop3724" 
    offset="0.35173747" 
    style="stop-color:#0202ff;stop-opacity:1;" /> 
    <stop 
    id="stop3720" 
    offset="0.48789391" 
    style="stop-color:#02fff9;stop-opacity:1;" /> 
    <stop 
    id="stop3718" 
    offset="0.70091939" 
    style="stop-color:#60ff18;stop-opacity:1;" /> 
    <stop 
    id="stop3714" 
    offset="0.83720928" 
    style="stop-color:#ffef15;stop-opacity:1;" /> 
    <stop 
    style="stop-color:#ff0000;stop-opacity:1;" 
    offset="1" 
    id="stop3710" /> 
</linearGradient> 

công trình cho tôi (thực hiện với inskape)

+0

Điều này gần như giống như tôi đã đăng ở đầu. Tôi hy vọng sẽ tìm cách chuyển đổi từ màu này sang màu khác bằng cách chỉ thay đổi màu sắc. – NVI

+0

@NV vì vậy bạn chỉ muốn có hai điểm dừng? –

0

Bạn đã thử sử dụng độ chính xác cao hơn trong% của mình chưa? Như Josh đang hiển thị, bạn có thể có độ chính xác phần trăm phụ và không gian dừng của bạn tốt hơn.