Marc Nijdam

Mental pressure relief valve

UIColor Shortcuts Revisited

Following up on a previous post on utilities for creating UIColor objects. I’ve started work on a new project where the designers prefer to work with web style colors in the typical CSS format #c5c5c5.

Needing to convert those to the floating point format I prefered in my previous post was laborious and didn’t allow for quick turn color changes with the designer.

Enter RGBX and RGBXA:

Which allow for UIColors to be created by coying the hex values from the design documents doing:

RGBX(0xc5c5c5);
RGBXA(0xc5c5c5, 0.8);

This reduced friction with in translating the visual design a lot for me. I hope it does for you to.

Ruby Segfault

I didn’t know why I was having all these weird problems with ruby segfault-ing while doing rake tasks in Octopress until I ran across this incredibly helpful gist. Thank you Brandon, site generation now works flawlessly.

Steve Jobs 1955–2011

I don’t even know how to express myself here, except that I feel the need to honor the man. I’ve been a developer, manager and technologist for almost 20 years. I never met Steve, nor was I that much into Apple products until about 5 years ago, when dabbling with iOS turned into a passion for mobile applications again.

I’ve since then come full circle. I’m proud to be a near full-time developer again, feel honored to target and use products that were built, née crafted by a team of people that care deeply about design and build and delivery excellence. All led by a visionary with a drive that I can only aspire to live by.

Thanks for bringing me full circle Steve. Your legacy lives on in our every day lives as users, companies, leaders, and developers. You didn’t just “make a ding in the universe”, you made a ding in each and every one of our lives and made it better.

My sincerest condolences to Steve's family, friends and colleagues.

CGGradientUtils

Just a quick gist to show what I do to create a CGGradient. It’s really just a wrapper to do type-casting and create a color array.

UIColor Shortcuts

Over the course of a number of projects I’ve been tinkering with how best to create the endless amounts of UIColor objects that need to be constructed. Most often the exact values of these come from visual designs that encode values as indexed RGB(A) value, HSV or in the most common case, actual mockups of the screen where I’m expected to just sample the color to get it close enough for the first few builds.

I initially used a category on UIColor added a couple of methods to provide integer 0-255 values for indexed RGB values.

I’ve since come to like a much simpler approach that (1) removes the verbosity of messages and (2) the float conversions. This is achieved through a couple of RGB(A) macros that I drop into my prefix file.

So instead of using

[UIColor colorWithRed:10 green:20 blue:30]

I’d use

RGB(0.04,0.08,0.12)

While the former is more Objective-C style, the latter is way more efficient to read and after a while (and a bit of designer education) it’s much easier to tweak the 0-1 float values to the desired end result.

I use the excellent Classic Color Meter (AppStore link) to meter these values out of the mock-ups. Works great for me and hope it’s useful for others.

Boot…

So here’s me bootstrapping Octopress up to try and replace imadjine.com with something that I’d actually consider maintaining and updating on a regular basis. I’ll introduce myself more properly in next post, but wanted to at least shout out to mindjunk’s setup page. Without those helpful gist bits the process wouldn’t have been nearly as easy. Thanks!