A simple package to draw swirl shapes
Project description
swirl.set_style()
modify the look and style of background color, pen color.
parameters:
style : {'random', 'shuffle', 'default'}, optional
- Data type : string, array like
- Description : It takes any one of the following styles.
"random": Automatically generate a random set of configurations for background and pen color."shuffle": Pick a random style every time the draw function is called."default": Revert back all/any changes made to theset_style()and use the default VIBGYOR color palette, white background, and black pen color.
color_style : {'random', 'all colors', 'pastel', 'default'}, optional
- Data type : string, array like
- Description : It takes any one of the following styles or a list of hex color codes:
"random": A random set of hex color codes will be generated automatically that will be used to draw the lines."all colors": This will generate hex colors that are not too light or pastel. They are more suitable for an image with a white background as they contrast with white."pastel": This will generate hex color codes that are of pastel colors. They are mostly suitable to be used with a black background color."default": This will use the fundamental VIBGYOR color palette['#537c78', '#7ba591', '#cc222b', '#f15b4c', '#faa41b', '#ffd45b']
num_colors : optional
- Data type : int
- Description : To allow users to specify the number of colors they want to use in their pattern, the
num_colorsparameter can be passed to the function. For instance, if the user intends to generate a pattern resembling the top of a pyramid, they can setnum_colorsto 3.
bg_style : {’random’}, optional
- Data type: string, array like
- Description: It takes either
“random”or any hex colour code as a parameter, which is used as a background colour for the canvas.
swirl.draw()
Draw a swirl drawing with the defined parameters and/or configrations from set_style() method.
parameters:
change_colors : optional
- Data type: bool
- Description: This parameter can be used to change the pen colour from black to colour. Use the
color_styleparameter in theset_style()method to customise the colors. By default swirl uses the VIBGYOR color palette['#537c78', '#7ba591', '#cc222b', '#f15b4c', '#faa41b', '#ffd45b'].
angle : non-optional
- Data type: float
- Description: This parameter is used to define the angle with which the swirl must be drawn.
iterations : default = 500
- Data type: int
- Description: This parameter is used to define the number of lines to be used. Each iteration draws one line.
change_colors : optional
- Data type: bool
- Description: This parameter is used to turn the colours on and off. When this is set True, the pen uses the default colors unless the
set_styleis modified.
change_width : optional
- Data type: bool
- Description: This parameter is used to gradually increases the width of each line in each iteration.
width_speed : optional
- Data type: bool
- Description: This parameter is used to set the speed at which the line width changes for each iteration.
circles : optional
- Data type: bool
- Description: This parameter is used to draw a circle after each line. The radius of the circle increases in every iteration.
rhombus : optional
- Data type: bool
- Description: This parameter is used to draw a rhombus after each line. The radius of the circle increases in every iteration.
random_moves : optional
- Data type: bool
- Description: This parameter is used to make random moves at every iteration.
swirl.save_result()
Save the swirl drawing
parameters:
File_name : optional
- Data type: str
- Description: This is used to name the file that is being generated.
png : optional
- Data type: bool
- Description: To save a
.pngversion of the drawing.
eps : default = True
- Data type: bool
- Description: To save the
.epsversion of the file.
swirl.clear()
Clear the canvas by erasing whatever has been drawn so far.
parameters:
None
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyswirl-0.0.1.tar.gz
(5.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyswirl-0.0.1.tar.gz.
File metadata
- Download URL: pyswirl-0.0.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d67126a2dfc90ee2b957aa775fe6d9bec796c94bee4645685a485c33dd15197
|
|
| MD5 |
e4bb91186df5e14c242b244f6f1b02b1
|
|
| BLAKE2b-256 |
67f3dd318e50f14cf296b698dd70f0efeb63e5dfbc6b28130029537c98be8ca8
|
File details
Details for the file pyswirl-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pyswirl-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4aeb78f7e0c920097f0f63964ea22ba7be675b2dd6a42be929d09eb1a5290acd
|
|
| MD5 |
02b027bfc79ea90ddd5c51674bd83277
|
|
| BLAKE2b-256 |
154cf8beef5523474de24d2125583232468be63bde2c659cfe2f3968baef16af
|