Last updated: January 19, 2015

 

Index

  1. Introduction

  2. Quick workflow

  3. Picking a color

         Current selectiona and last selection

  4. Adding a color to the status menu

         Deleting color commands

  5. Generating code

         color methods

  6. Preferences

         a) General settings


 

1. Introduction: When you develop a Mac OS X or an iOS application, the color is something you always deal with.  And you may have particular RGB colors that you often work with.

 

Mac software ObjColors

Screenshot 1-01

 

ObjColors is a developer tool that lets you store RGB colors you often work with.  The application comes with a status menu in a way that you can generate Objective-C or Swift code for the selected color on the status menu.

 

Mac software ObjColors

Screenshot 1-01

 

When you select a color on application's status menu, there are different ways in which it can be expressed as a line of code.  As discussed above, the application supports two languages - Objective-C and Swift.  Also, it supports both two development platforms - Mac OS X and iOS.  All you have to do is make your options with two toggle buttons above color commands when generating code.

 

Mac software ObjColors

Screenshot 1-01

 

2. Quick workflow: ObjColors's workflow goes as follows.

 

  1. ObjColors offers different ways by which you can select a color.  An easy way of selecting a color is just to pick and click on 1 of 216 color squares inside the quick pick group box.  These color squares can be arranged in four different ways.  So click on one of the four tabs above.
  2. After you select a color, click on the add color toolbar button.  And the color that is currently selected will be added to the status menu.
  3. In order to generate code, first, explore application's status menu.  Then use two toggle buttons to set your development platform (OS X or iOS) and development language (Objective-C or Swift).  Then just select a color command on the status menu.

 

3. Picking a color: ObjColors offers three different ways by which you can select a particular color.  Each group box except the very bottom one represents a method.

 

    1. Quick pick: There are 216 color squares, each of which is clickable.  These colors are well-ordered and can be ordered differently.  Click on any of the tabs above to change order of appearance.  That being said, though, the same set of colors is not necessarily used in all four arrangements.  Furthermore, just because there are 216 different colors, that doesn't mean they are all web-safe colors.
    2. Color-panel pick: Click on the color button, and you can select a particular color with Color Picker.
    3. Drop pick: You can drag and drop an image file onto the drop box inside this group box to scan the pixel at certain coordinates.  A dropped image must have dimensions of at least 8 pixels x 8 pixels.  Regardless of the image size, a color will be picked at (4,4).

 

Quick pick probably offers the easiest way by which you can select a color.  When you place your mouse pointer over a color square, the values of the color where your mouse pointer enters are expressed in RGB and HTML (Hex) forms.  (See Screenshot 1-01.)  Also, the color over which your mouse pointer enters will appear in a square box to the right.

 

Mac software ObjColors

Screenshot 1-01

Mac software ObjColors

Screenshot 1-02

 

There are 216 colors available inside the quick pick group box.  You can change the order of appearance by clicking on one of the four tab buttons.  Now, when you actually click on a color square, its precise RGB, HTML (Hex), HSB (hue, saturation, brightness) values will appear inside the color values group box at the bottom.  (See Screenshot 1-02.)  And the rectangle to the right of the current selection label will be painted with the color of your selection.  When you click on and select another color, the first color will be pushed to the rectangle to the right of the last selection label.

The Quick pick group gives you only several hundred different colors to choose from.  Considering that there are an infinite number of colors in reality, that's not many.  If you want a wider range of colors to choose from, you should use Color Picker.  Click on the color button inside the color-panel pick group box to open Color Picker.  (See Screenshot 1-03.)

 

Mac software ObjColors

Screenshot 1-03

Mac software ObjColors

Screenshot 1-04

 

If you want to pick the color of a pixel from an image file (An image must have at least 8 pixels x 8 pixels.), you can just drag and drop a file onto the drop box inside the drop pick group box.  (See Screenshot 1-04.)  The graphic format that the application reads depends on your sytem.  It should be able to read such formats as BMP, GIF, JPEG, JPEG 2000, PDF, PNG, PSD, TIFF.  Regardless of the image size, the application will pick the color of a pixel at (4,4).

Actually, there is another way of selecting a color.  You can manually express a color.  For example, enter 240, 0, 0 in RGB fields.  Then press RETURN inside any of those fields.  And the corresponding color will appear to the right.  (See Screenshot 1-05.)  Similarly, you can manually enter an HTML value and HSB values to express a color.

 

Mac software ObjColors

Screenshot 1-05

Mac software ObjColors

Screenshot 1-06

 

4. Adding a color to the status menu: Regardless of the manner by which you select a color, the color that matters to the application is the one appearing over the rectangle to the right of the current selection label.  If this rectangle assumes a color, the Add color toolbar button will become active.  (See Screenshot 1-06.)  By clicking on this toolbar button, you can add the current color to the status menu.  Next, try exploring application's status menu.  And you should find a new color command based on the current color selection.  (See Screenshot 1-07.)

 

Mac software ObjColors

Screenshot 1-07

Mac software ObjColors

Screenshot 1-08

 

So it's just the matter of clicking on the add color toolbar button to add the current color selection to the status menu.  How do we delete any of those color commands on the status menu?  Simply, click on one over the status menu while you hold down the control key.  And you will be prompted for confirmation.  (See Screenshot 1-08.)  Another way of deleting color commands is to first open Colors by clicking on the Open colors toolbar button.  (Or choose Show Colors under Color.)  A separate window titled Colors will appear with a list of colors you have saved.  (See Screenshot 1-09.)  If you want to delete any of them, just select one in the list.  Then click on the Delete color button below.  Or click on Delete all colors button to delete all saved colors.

 

Mac software ObjColors

Screenshot 1-09

Mac software ObjColors

Screenshot 1-10

 

5. Generating code: ObjColors doesn't just let you save color objects as RGB values.  You can generate a line of Objective-C or Swift code for the color command you select.  Notice that there are two toggle controls over application's status menu.  (See Screenshot 1-10.)  The top one represents an development platform option.  So click on OS X or iOS.  The second control lets you select a development language.  Based on these options, a line of code that you get to generate will differ.  In reference to Screenshot 1-10, the line of code pasted on a TextEdit document is for OS X.  And the language is Objective-C.  Screenshot 1-11 shows a case where the development language is Swift.  Of course, a line of code that you get is now different.

 

Mac software ObjColors

Screenshot 1-11

Mac software ObjColors

Screenshot 1-12

 

You should realize that the color method that is applied to the code shown in Screenshots 1-10 & 1-11 is colorWithRed:green:blue:alpha.  That's the default color method for this application simply because it's the only choice for iOS when it comes to RGB colors.  If you work on NSColor for OS X, there are more color methods including colorWithCalibratedRed:green:blue:alpha:, colorWithDeviceRed:green:blue:alpha:, colorWithSRGBRed:green:blue:alpha:.  If you want to choose any of them, then open Preferences by clicking on its toolbar button.  Then turn on the checkbox that says Don't use colorWithRed (OS X only).  (See Screenshot 1-12.)  Now, just click on one of the toggle buttons below.  Screenshot 1-13 shows a case where the selected method is colorWithCalibratedRed.  You may notice that there is something else different from previous lines of code.  The color values are expressed in fractions, right?  By default, they are expressed in decimal numbers.  If you want to express color values in fractions, then turn on the checkbox that says Color values in fractions, opening Preferences.

 

Mac software ObjColors

Screenshot 1-13

Mac software ObjColors

Screenshot 1-14

 

Finally, if you regularly work on a different development platform other than OS X or on a different development language other than Objective-C, you can save your options by selecting Save Code Settings over application's status menu.  (See Screenshot 1-14.)  Next time when you launch the application, ObjColors will select your default development platform and language at startup.

 

 

 

 

 

 

 

 

 

 

 

<< Previous page   Next page >>