Most web pages use hexadecimal triplets to define colors (for example: #ffffff is white or 255,255,255 in RGB). And most graphics software tools use RGB for colors. But if you're using a Macintosh, it's easy to use the built-in calculator to convert RGB colors to hexadecimal codes.
Time Required: 5 minutes
- Choose an RGB color you would like to convert. For example, a golden yellow in RGB is (177,102,0).
- Open the calculator. This is typically in the “Applications” folder, but if you can’t find it there, then search in Spotlight for “Calculator.”
- Enter the first number in the RGB code into the calculator. In my example, that would be 177.
- Go to the “View” menu and choose “Programmer.” (the shortcut key is Cmd-3).
- The number in the input box will change to a number in the format
0x0. The characters after the first “0x” is what you want. In this case
- Go back to the “Basic” calculator (the shortcut key is Cmd-1).
- Repeat with the two remaining RGB codes. For my example, I get 66 and 00. My resulting hexadecimal code is
- I strongly recommend you only use browser-safe colors. These are colors that display accurately on more browsers and platforms.
- With CSS you can define colors using the RGB codes. You write
color: rgb(177,102,0)rather than the hexadecimal code.
- If you have a “Calculator II” you can use this to convert to Hex as well, just press the “HX” button to see the hexadecimal number.
What You Need
- Macintosh OS X Calculator