Micro because I assume that interest in what I have to say will be generally inversely proportional to the time I spend saying it.

Photoshop hex RGB to a UIColor

Written by on February 2, 2012, 1:16 am

Adam (the awesome goCatch designer) and I got sick of converting from hex RGB colors to decimal UIColor initialisation params, so I wrote this script.

import sys if (len(sys.argv) != 2): print ("convert.py <hex color>") sys.exit () color = sys.argv[1] if (len (color) != 8): print ("convert.py <8 char hex color>") sys.exit () # get the two character chunks red = color[:2] green = color[2:4] blue = color[4:6] alpha = color[6:8] decRed = int (red,16) / 255.0 decGreen = int (green,16) / 255.0 decBlue = int (blue,16) / 255.0 decAlpha = int (alpha,16) / 255.0 #iOS code print ("[UIColor colorWithRed:%.4f green:%.4f blue:%.4f alpha:%.4f];" % (decRed, decGreen, decBlue, decAlpha)) #Android code print ("private static final int COLOR = 0x"+alpha+red+green+blue);

Yep it also does an Android static final int. We love Android too ;)

Permalink - Comments - Tags: Development,Android,iPhone

Thanks for the fish

Written by on January 3, 2012, 9:52 am

At the end of a nine years at Cognethos. Today, nine years at any company is a ridiculously long time. Though the company expanded and contracted over time, the core group of employees stayed the same. We worked through boom times, global financial crisis, uncertainty, wild speculation and fundamental disagreement, and somehow managed to treat each other with respect. I am proud of the work we produced and grateful for everything I learnt.

I don't need to wish this very talented group of people luck, as clearly they won't need it.

Permalink - Comments - Tags: Development,Misc

A Farewell to Arms - Ernest Hemingway

Written by on December 21, 2011, 2:51 am

I enjoyed large parts of this book, but I am a little relieved it is over.

Permalink - Comments - Tags: Books,Reviews

Merry Christmas

Written by on December 20, 2011, 3:50 am

Permalink - Comments - Tags: Art?

WTF is PC Load Letter?!

Written by on November 24, 2011, 7:14 am

Permalink - Comments - Tags: Misc