Inkscape.org
Beginners' Questions Importing a Gradient?
  1. #1
    Supernaut Supernaut @Supernaut

    Hi
    I am to Inkscape, People Suggested this Gradient Generator.
    But it comes in the Form of a CSS Code not SVG.
    How can I Import it into Inkscape?

    https://www.joshwcomeau.com/gradient-generator/

    .gradient {
      background-image: linear-gradient(
        45deg,
        hsl(240deg 100% 20%) 0%,
        hsl(281deg 100% 21%) 8%,
        hsl(304deg 100% 23%) 17%,
        hsl(319deg 100% 30%) 25%,
        hsl(329deg 100% 36%) 33%,
        hsl(336deg 100% 41%) 42%,
        hsl(346deg 83% 51%) 50%,
        hsl(3deg 95% 61%) 58%,
        hsl(17deg 100% 59%) 67%,
        hsl(30deg 100% 55%) 75%,
        hsl(40deg 100% 50%) 83%,
        hsl(48deg 100% 50%) 92%,
        hsl(55deg 100% 50%) 100%

  2. #2
    David248 David248 @David248
    *

    The manual way (I don't know an automated one).

    • Draw a rectangle, open fill and stroke panel (ctrl + shift + f), choose fill tab and choose a gradient fill.
    • Inkscape creates a gradient with two stops, whose color are displayed in circular icons
    • Click on the lower one to select it. Choose HSL mode (dropdown button, set to RGB by default, middle right of fill and stroke panel) and set A: value to 100, H: to 55, S: to 100 and L: to 50 (the last line of your code ). On my screenshot, you can see I made a small error for the middle stop : S=82 instead of 83.
    • Repeat for the first one : H=240 / S=100 / L=20 and if necessary, set A: to 100.
    • Now add 11 stops by clicking on + icon bottom left of Fill & Stroke Panel.
    • You can set the position of the stop (8% for the second line of the css code) in the Stop Offset field just above the Color mode button you used when switching to HSL mode. Here, use + an - buttons to set it to 0.08 (8%). On my screenshot, Stop Offset displays 0.5 corresponding to 50% of the css code.

    I recommand first setting all stops positions, then entering all the HSL values (it was easier, to me).

    I attached the SVG file with your gradient if you are lazy.

     

  3. #3
    Supernaut Supernaut @Supernaut

    Thank You for the Help David!!

    Most Appreciated!!!!