Rainbow Spiral with Arbitrary number of colors?

Post questions on how to use or achieve an effect in Inkscape.
Ebunny
Posts: 5
Joined: Wed Jan 08, 2014 2:07 am

Rainbow Spiral with Arbitrary number of colors?

Postby Ebunny » Wed Aug 19, 2015 11:54 pm

I'd like to achieve the following effect, with an arbitrary number of colors:

Screen Shot 2015-08-19 at 9.49.12 AM.png
Screen Shot 2015-08-19 at 9.49.12 AM.png (99.09 KiB) Viewed 4353 times


Any ideas? Bonus points for being able to control the amount of swirl!

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Rainbow Spiral with Arbitrary number of colors?

Postby Lazur » Thu Aug 20, 2015 12:51 am

If those are circles, maybe you can try to use many radial gradients.
If you do it right, you may be able to adjust only one gradient's steps -or paste in a pre-drawn gradient's definition in the xml editor.
Haven't tried, my closest was drawing a conic gradient from linear gradients.

If they are of other shapes than circles/ellipses, or anything you could fill with a combination with linear and radial gradients, then setting the right colours easily is the only problem.
You may use interpolate attribute in group to fill the parts from black to white,
export to png and use gimp to map a gradient over it.


Theoretically you can draw anything with gradient meshes as vectors, although editing it to the shape and setting colours would be painful.
Changing colours would be easier with a filter then.

User avatar
bartovan
Posts: 191
Joined: Sun Feb 09, 2014 4:14 am
Location: Belgium
Contact:

Re: Rainbow Spiral with Arbitrary number of colors?

Postby bartovan » Thu Aug 20, 2015 1:07 am

The easiest way would seem to me by coding it (i.e. in Javascript), as it's very mathematical. But that's something I'd like to get into one day.
Basically it seems to be a question of setting up the canvas, then describing in Javascript the forms needed, which in this case with a few iterations would be easily done (making one form, then rotating and changing color at each iteration). Then feed this to a browser, which would create the image. Which then could be saved and opened in Inkscape (?). If someone knwoledgeable would like to give an example of that or comment (or have a good link), I'd be very interested!

I'd get somewhere manually by superposing wheels with three curled spokes, duplicating them, rotating them through transformation, and then changing colors, but that seems tedious, I'm very curious what the real gurus will come up with :)
Portfolio bartovan.com
Tumblr / Instagram / Pinterest / Facebook / Twitter / OpenClipArt
Shop at Society6 / RedBubble
Using latest stable Inkscape on Ubuntu (current stable release) and Win 7.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Rainbow Spiral with Arbitrary number of colors?

Postby ragstian » Thu Aug 20, 2015 3:33 pm

Hi.

You could try using tiled clones as in the following example:


SVG Image
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

User avatar
bartovan
Posts: 191
Joined: Sun Feb 09, 2014 4:14 am
Location: Belgium
Contact:

Re: Rainbow Spiral with Arbitrary number of colors?

Postby bartovan » Thu Aug 20, 2015 4:47 pm

ragstian wrote:You could try using tiled clones as in the following example

Interesting! Could you copy here the settings you used in the "Create tiled clones" dialog please?
Portfolio bartovan.com
Tumblr / Instagram / Pinterest / Facebook / Twitter / OpenClipArt
Shop at Society6 / RedBubble
Using latest stable Inkscape on Ubuntu (current stable release) and Win 7.

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: Rainbow Spiral with Arbitrary number of colors?

Postby Xav » Thu Aug 20, 2015 7:34 pm

Tiled clones would be the way I would go, as well. It's not quite as simple as sharing the settings in the dialog though, as there's a little setup to do to get the right shape for cloning. Here's my approach:

1) Decide how many segments you want in the final design. I've gone for 36 in this example.
2) Draw a circle.
3) Using the :tool_selector: tool, select it then click a second time to make the rotation centre visible.
4) Hold CTRL and drag the rotation centre downwards until it's as the bottom of the circle.
5) With the circle selected, open the Tiled Clones dialog. HIt the Reset button.
6) Enter 2x1 for the number of rows and columns.
7) Use "P1: simple translation" on the Symmetry tab.
8 ) On the Shift tab, tick the "Exclude tile" checkbox in the Per Row column.
9) On the Rotation tab set the Per Row angle to 360/number of segments. I.e for my 36 segments I entered 10. (Hint: In 0.91 you can do maths in the field directly, so enter "360/36" then hit return, changing "36" to the number of segments you want).
10) Hit the Create button.

Let's pause for breath here. You should now have three objects: your original circle, and two clones. We'll use these to create a crescent shape, so that when we do the "proper" clones we don't end up with the first ones being obscured by the last ones (which is what will happen if we just wade straight in with circles).

Your original object should still be selected. Assuming the default Inkscape settings of unlinking clones when the original is deleted, rather than removing them, do this to create your crescent:

11) Press Delete to remove the original. Your two clones are now converted into real circles.
12) Select both circles and do Path > Difference.
13) Yay! You've got a crescent! Before we clone it, we'll need to move the center of rotation again. Place it at the tip of the bottom "arm" of the shape.
14) To get the colours to change when we clone, we first have to unset the fill on the crescent. With it selected, right click on the colour swatch at the bottom left of the Inkscape window and select "Unset fill". The crescent should turn black.

Now the preparatory work is done, and we're ready to clone. Your dialog should already contain the settings we used earlier, so there's not a lot more to do:

15) With the crescent selected, return to the Tiled Clones dialog and set the rows and columns to 36 (or whatever) x 1.
16) On the Colour tab click the "Initial colour" swatch and set it to something appropriate. I went with "ff0000ff" - 100% red.
17) In the Per Row "H" field, set the amount of colour change you want. E.g. to have one cycle of colours, use 100/36, or 100/18 for two, 100/9 for four (again, based on 36 segments).
18) Click the "Create" button.

If you want the crescents going in the opposite direction you can select the whole shape at this point and flip it horizontally, or just flip the original crescent after step 14.

You can optionally delete the original to turn everything in to real objects rather than clones. If you leave it intact, you might want to move it from behind the clones, as it can bleed out a little due to anti-aliasing (or a lot, if you apply a blur).

colour_wheel.png
colour_wheel.png (34.82 KiB) Viewed 4254 times

colour_wheel_3.png
colour_wheel_3.png (37.12 KiB) Viewed 4254 times
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

blighty
Posts: 13
Joined: Wed Jan 29, 2014 7:30 pm

Re: Rainbow Spiral with Arbitrary number of colors?

Postby blighty » Thu Aug 20, 2015 7:59 pm

Ebunny wrote:I'd like to achieve the following effect, with an arbitrary number of colors:
Any ideas? Bonus points for being able to control the amount of swirl!


Gimp has a built in function for creating spirals. Very easy to use.

I have created 2 sample images using a built-in Gimp gradient. I you want different colours you can build your own gradient. If you need help, ask at http://gimpforums.com/forum-beginners.

I am having difficulty attaching images here. Hope this works.
Example 1: Image
Example 2: Image

blighty
Posts: 13
Joined: Wed Jan 29, 2014 7:30 pm

Re: Rainbow Spiral with Arbitrary number of colors?

Postby blighty » Thu Aug 20, 2015 8:54 pm

blighty wrote:I am having difficulty attaching images here. Hope this works.
Example 1: Image
Example 2: Image


Didn't work. Revert to the Copy and Paste option.
Example 1: http://imgur.com/Ur86Xm6,jq38m1g
Example 2: http://imgur.com/Ur86Xm6,jq38m1g#1

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Rainbow Spiral with Arbitrary number of colors?

Postby Lazur » Sat Aug 22, 2015 9:25 am

This one is an interesting problem.

Made this gradient spiral:

Image

Using one gradient definition, so it should be possible to edit all the colours at once.
Changing the shape in a live way? No, it is not possible.
It is based on a circle cut with a point-symmetric cut-line, and a half of the circle as the base tile.
In an other case a "dynamic block" could be hacked together, but this one doesn't works. (To use cloning on a half of the cut-line, rotate a clone, and... no, a compositing/cut lpe would be necessary, that could use a group as an input.)
You need to draw the base tile and start from scratch if you want to change the shape too.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Rainbow Spiral with Arbitrary number of colors?

Postby brynn » Sat Aug 22, 2015 1:27 pm

Do you have the option to allow gradient sharing enabled?

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Rainbow Spiral with Arbitrary number of colors?

Postby Lazur » Sat Aug 22, 2015 9:38 pm

Yes.

I did missed that part first, but in 0.91 you just need to click on the padlock icon in the gradient tool's settings.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Rainbow Spiral with Arbitrary number of colors?

Postby brynn » Sat Aug 22, 2015 11:10 pm

See attached.

Are those gradient handles? The horizontal lines? I don't understand why they seem to be going to infinity. Maybe you just need to wait an hour or 2, for all the gradients to update to the new edit? (joking) How large this image?

From the canvas, I can only select the red stop.... Never used that new Gradient tool control bar....

I didn't have any trouble changing red stop to white - all objects updated immediately.

Edit
Did you ungroup? Enter the group?
Attachments
gt.png
gt.png (73.44 KiB) Viewed 4102 times

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Rainbow Spiral with Arbitrary number of colors?

Postby Lazur » Sat Aug 22, 2015 11:40 pm

At the top dropdown menu you can select the stops.
It updates pretty fast.

Yes, all objects have a very stretched linear gradient, so they all appear to have a flat fill -that is the trick of it!
(That gradient is 900000 px wide -as the original shape was 2500 px wide, and wanted to make 360 of them of separate colours --->360*2500=900000.
Also the related ghosting bug.)

Trying to involve cloning but so far it doesn't really work -couldn't yet add the same fill to all of them, because the fills get transformed regardless the icon of transforming fills is not toggled.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Rainbow Spiral with Arbitrary number of colors?

Postby brynn » Mon Aug 24, 2015 6:40 pm

..... -that is the trick of it!


For most of your complex images, I can't figure out "the trick of it"!


Return to “Help with using Inkscape”