Green

RGB Distance Calculation

When you pick colours for a mobile device on your fancy 16-million-or-so-individual-colours monitor you need to be sure the mobile device with it’s much smaller colour depth can represent your colours distinctly, that the device’s palette will be able to ‘see’ the difference between your 2 stylish grays and not turn it into a big blob.

For the Sony Ericsson K750i any 2 colours with a RGB distance greater than 12 will survive.

So, to calculate the RGB distance between two reds for example, RGB (164, 12, 0) and RGB (195, 38, 26) first calculate the differences between the individual colours:

R: 195 - 164 = 31 G: 38 - 12 = 26
B: 26 - 0 = 26

Add the squares of the three colour differences together:

31² + 26² + 26² = 2,313

The RGB distance is the square root of the sum of the squares above:

RGB distance = √2,313 = 48

48 is greater than the stated threshold of 12 for this device so we’re laughing. Of course, trial and error is probably quicker but I just thought this was kind of interesting.

«2 CommentsAugust 13, MMV»

Reader Comments

SWM said on Sat 13 Aug at 19:29:

This post makes me want to beat you up when I next see you. Yes, I know. But still, I will at least try and hurt you.

stephen said on Sun 14 Aug at 01:49:

May I ask why you are driven to attempt this futile and, if I many say, dangerous (possibly fatal) undertaking?


Name:

Email:

URL (optional):

What colour is an orange?:

Comment (comments use Textile formatting):

About This

You've arrived at the homepage of Stephen Stewart. The archive is available here for those who want it. This site is happily hosted by Dreamhost. Click for more?

More!? OK then, but I can't help feeling that this will be a disappointment to you.
I work as a web designer in Belfast, and I live by the sea in a shoe. You can see me here, doing my livejournal pose as idoru called it. If you need to you can email me at carisenda -at- gmail -dot- com.

My hCard

Stephen Stewart
Donaghadee , County Down Northern Ireland

Recent Comments


Recommended Viewing

  • 300rating
    Does exactly what it says on the (comic book) tin. Loved it.
  • Little Miss Sunshinerating
    Very funny, disturbing (the beauty pageant) and completely messed up -- but in a good way.
  • Laputa: Castle in the Skyrating
    Story great, characterization a little on the weak side -- though the big robots are cool.
  • Porco Rossorating
    Stylish, funny, exciting.
  • Grave of the Firefliesrating
    Very sad, which was a little unexpected since I didn't know much about it before watching it. Can be a little too slow in places though, otherwise it's very good.
  • Nausicaä of the Valley of the Windrating
    The story can get a little dense at times what with the various factions, but still really enjoyable, inventive and engaging.
  • X-Men: The Last Standrating
    Opportunity, talent, money - all blown. Over 3 films X-Men has hinted of something great that could have been, this last one says "No, sorry - not going to happen". Bah.

flickr.com


Main Atom Feed, Photoblog Atom Feed, Linkblog Atom Feed, Technorati Profile
Powered by Movable Type 3.34. Design © Stephen Stewart. Happily hosted by Dreamhost.