Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update icon.rb #9

Closed
wants to merge 1 commit into from
Closed

Conversation

YoungWillem
Copy link

Hello Andy!

I am slowly figuring this GitHub thing out and am fairly new to Ruby as well, so let me know if I'm going about this the wrong way. :)

I have added the modify method to icon.rb, which implements most of the options available on the game-icons.net studio. You can now use the color presets, or add a frame, stroke, gradients, shadow, etc. to your icon.

It will also accept all the same color strings as Squib does!

Here are a few test lines you can drop into Squib to see what it does:
svg data: GameIcons.get('spiral-lollipop').modify(preset: 'candy', shape: 'star7').string, layout: 'art', width: 400, height: 400, x: 200, y: 200
svg data: GameIcons.get('chocolate-bar').modify(shape: 'rounded-square', cr: 128, bg_gradient: 'o', bg: 'light_brown', bg2: 'dark_brown', fg_gradient: '/', fg: :chocolate, fg2: :chestnut).string, layout: 'art', width: 400, height: 400, x: 200, y: 600

I hope you find it useful!

card_00

Added modify method, which implements most of the options available on the game-icons.net studio.
@coveralls
Copy link

Coverage Status

Coverage decreased (-38.06%) to 61.0% when pulling 267b92c on YoungWillem:modify into f108e72 on andymeneely:master.

@andymeneely
Copy link
Owner

This is really interesting - thank you for the PR! I don't think I'm going to integrate it - I want to keep this library simple and if people want to do more custom modifications they can on their own. I'm going to go over this and document some snippets, though, so that people can adapt to their liking.

@andymeneely andymeneely closed this Dec 1, 2020
andymeneely added a commit that referenced this pull request Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants