Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
OrganizationEventAdvent CalendarQiitadon (β)
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

How to use custom color on OSX Preview Highlight/Markup (supporting Yosemite / El Capitan)

Note: Yosemite requires a small utility. You can see the source code below.

Japanese procedure is below.

  1. Open Inspector using Command+I.
  2. Open Font Panel using Commad+T and open Color Panel from it (then you can close Font Panel).
  3. Markup a text using any color.
  4. Enter edit mode and select something (circle, line, text ... can be any).
  5. Select the markup in the Inspector.
  6. Now you can change the color using Color Panel.
  • Now marker keep to use that color until you change it into default color.
  • You cannot set the color to use nextly without changing existing marking.
  • Also selecting colors in highlight mode(blue marker icon) is invalid.
    • This might be a bug of Preview...

Japanese procedure
1. Command+Iでインスペクタを開きます。
2. Command+Tでフォントパネルを開き、そこからカラーパネルを開きます(フォントパネルは閉じて構いません)。
3. テキストをハイライトします。色はなんでも構いません。
4. 編集モードにして、何か選択します(円、線、テキスト…何でもいいです)
5. ハイライトをインスペクタから選びます。
6. カラーパネルより色を変更することができます。

  • 色を(デフォルトに)切り替えるまで、ハイライトモードはその色を使ってハイライトを行います。
  • 既存のハイライトの色を変えずに次のハイライトの色を設定することはできません。
  • ハイライトモードのまま色を選択しても反映されません。
    • プレビューのバグな気がします。

[for search]
Mountain Lion, Mavericks

Yosemite / El Capitan

  • Unfortunately, this procedure cannot be applied to Yosemite.
    • It looks like usual Adobe Reader or PDF Reader Pro Free can be alternative,
    • but you might want to backup Mavericks' Preview.app, which works at least on Yosemite.
  • Or, you can use this small app to hack plist and killall cfprefsd to flush it. Of course you should quit Preview first, which is not so combinient...
//compile with: clang -W -Wall changehighlight.m -framework AppKit
#import <AppKit/AppKit.h>

char cmd[2048];

int main(int argc,char **argv){
        fprintf(stderr,"changehighlight Listname Colorname\nexample: Apple Orange / Crayons Lime\n");
        return 1;
        int ver=0;
            int c;
            FILE *funame=popen("uname -r","r");
                printf("It looks like you are using Lion or former. This app is useless and might cause unexpected result. Are you sure to continue? [y/N] ");
                if(c!='y'&&c!='Y')return 1;

        //get color
        NSColor *color=nil;
            NSString *listname=[NSString stringWithCString:argv[1] encoding:NSUTF8StringEncoding];
            NSString *name=[NSString stringWithCString:argv[2] encoding:NSUTF8StringEncoding];
            for(NSColorList *colorlist in [NSColorList availableColorLists]){
                if([[colorlist name] isEqual:listname]){
                    color=[colorlist colorWithKey:name];
                fprintf(stderr,"color name looks invalid\n");
                return 1;
        NSData *data=[NSArchiver archivedDataWithRootObject:color];
        NSString *desc=[data description];

        //do the hack
        strcpy(cmd,"defaults write \"");
            // Yosemite
            strcat(cmd,"/Library/Group Containers/com.apple.Preview/Library/Preferences/com.apple.Preview.plist");
        }else if(ver>=11){
            // Lion,Mountain Lion,Mavericks and El Capitan
        // PVAnnotationColor_8:   highlight
        // PVAnnotationColor_9:   delete line (need to use right click menu)
        // PVAnnotationColor_10:  under line (not functional)
        strcat(cmd,"\" PVAnnotationColor_8 \"");
        strcat(cmd,[desc UTF8String]);
        system("killall cfprefsd");
        return 0;

List of Colors with usual OSX configuration:

Apple Black
Apple Blue
Apple Brown
Apple Cyan
Apple Green
Apple Magenta
Apple Orange
Apple Purple
Apple Red
Apple Yellow
Apple White

Crayons Cantaloupe
Crayons Honeydew
Crayons Spindrift
Crayons Sky
Crayons Lavender
Crayons Carnation
Crayons Licorice
Crayons Snow
Crayons Salmon
Crayons Banana
Crayons Flora
Crayons Ice
Crayons Orchid
Crayons Bubblegum
Crayons Lead
Crayons Mercury
Crayons Tangerine
Crayons Lime
Crayons Sea Foam
Crayons Aqua
Crayons Grape
Crayons Strawberry
Crayons Tungsten
Crayons Silver
Crayons Maraschino
Crayons Lemon
Crayons Spring
Crayons Turquoise
Crayons Blueberry
Crayons Magenta
Crayons Iron
Crayons Magnesium
Crayons Mocha
Crayons Fern
Crayons Moss
Crayons Ocean
Crayons Eggplant
Crayons Maroon
Crayons Steel
Crayons Aluminum
Crayons Cayenne
Crayons Asparagus
Crayons Clover
Crayons Teal
Crayons Midnight
Crayons Plum
Crayons Tin
Crayons Nickel

"Web Safe Colors" 003366
"Web Safe Colors" 99CCFF
bla bla...

System alternateSelectedControlColor
System alternateSelectedControlTextColor
System controlBackgroundColor
System controlColor
System controlDarkShadowColor
System controlHighlightColor
System controlLightHighlightColor
System controlShadowColor
System controlTextColor
System disabledControlTextColor
System gridColor
System headerColor
System headerTextColor
System highlightColor
System keyboardFocusIndicatorColor
System knobColor
System labelColor
System quaternaryLabelColor
System scrollBarColor
System secondaryLabelColor
System secondarySelectedControlColor
System selectedControlColor
System selectedControlTextColor
System selectedKnobColor
System selectedMenuItemColor
System selectedMenuItemTextColor
System selectedTextBackgroundColor
System selectedTextColor
System shadowColor
System tertiaryLabelColor
System textBackgroundColor
System textColor
System windowBackgroundColor
System windowFrameColor
System windowFrameTextColor
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Help us understand the problem. What are the problem?