Code Monkey home page Code Monkey logo

swiftcolorgen's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ“ฑ I'm a senior iOS developer, working with iOS for 7+ years
  • ๐ŸŒฑ Currently learning SwiftUI, Combine framework, Async Await
  • ๐Ÿ”ญ Working on a personal app, planning to release next year
  • ๐Ÿ“ซ How to reach me: LinkedIn, Twitter, email

swiftcolorgen's People

Contributors

fernandodelrio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swiftcolorgen's Issues

Invalid color functions generated

Two of the colors that got generated for my project were invalid/didn't compile:

/// Color #FF0000 (alpha 217)
class func genFF0000 (alpha 217)() -> UIColor {
	return UIColor(named: "FF0000 (alpha 217)") ?? UIColor.white
}

/// Color #E00000 (alpha 217)
class func genE00000 (alpha 217)() -> UIColor {
	return UIColor(named: "E00000 (alpha 217)") ?? UIColor.white
}

Let me know what else would be helpful to debug

Remove "namedColor" duplicates that Xcode generates sometimes

Sometimes when assigning a Named Color inside the storyboard, Xcode adds a duplicated entry for the same namedColor in the storyboard's xml. This can be easily seen, even without using this tool, just start assigning the same Named Color to different places, and you should see the duplicated entry in the xml.

If you re-open the interface builder, Xcode should display a warning about that and then it will remove the duplicated entry. I found an open radar for that: https://openradar.appspot.com/35172913

If we run SwiftColorGen, it will not remove the duplicated entry and when the Interface Builder reloads, the user will have the false impression, the tool introduced an error.

Considering that, a enhancement can be made:

Everytime SwiftGen runs, it should ensure there's no duplicates in the namedColor keys in the storyboard xml's.

Reduce storyboard number of changes

The storyboard's XML is read, modified and then rewritten. The order of the tag's properties will probably change every time (AEXML won't keep the original order). This is bad considering that a diff will accuse a whole file difference on all storyboards, making a Code Review harder.
Need to check if it's possible to rewrite the storyboard with the minimum of changes (with the diff only accusing the real changes made)

Add updated demo video

  • Shorter demo.
  • No errors shown
  • No need to select sRGB colors
  • Demonstrate other color spaces
  • Maybe some subtitles could help

Add tests

  • Validate the if the tool generates what is expected
  • Ensure 100% code coverage

Getting Compile Time Error

Trying to integrate this in one of my projects but getting compile time error since it has a dependency on SwiftColorGenLibrary.

screen shot 2019-03-08 at 4 42 34 pm

Colors as Computed Properties

I would prefer seeing the generated colours added as computed properties, as we are simply accessing a defined value of a particular type - and not doing any functional computation or state changing.

Issue updating colors on the Assets catalog color picker

Everything works fine if using the sRGB color space there, but other color spaces fails. The tool is ready to work with any color space but, this is not implemented on the Asset catalog itself.
Just need to ensure, the values are persisted in sRGB converting from other color spaces (as done in the other places)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.