Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milligramme/416d6cb51a8cb555052b to your computer and use it in GitHub Desktop.
Save milligramme/416d6cb51a8cb555052b to your computer and use it in GitHub Desktop.
bug in InDesign XXXStyle.previewColor
var UIC = [
"BLACK",
"BLUE",
"BRICK_RED",
"BROWN",
"BURGUNDY",
"CHARCOAL",
"CUTE_TEAL",
"CYAN",
"DARK_BLUE",
"DARK_GREEN",
"FIESTA",
"GOLD",
"GRASS_GREEN",
"GRAY",
"GREEN",
"GRID_BLUE",
"GRID_GREEN",
"GRID_ORANGE",
"LAVENDER",
"LIGHT_BLUE",
"LIGHT_GRAY",
"LIGHT_OLIVE",
"LIPSTICK",
"MAGENTA",
"OCHRE",
"OLIVE_GREEN",
"ORANGE",
"PEACH",
"PINK",
"PURPLE",
"RED",
"SULPHUR",
"TAN",
"TEAL",
"VIOLET",
"WHITE",
"YELLOW"
];
var create_guide_with_uicolor_and_style_preview_color = function (doc, list) {
doc.layers[0].layerColor = [255,255,255];
for (var i=0, len=list.length; i < len ; i++) {
var tf = doc.pages[0].textFrames.add({geometricBounds: [(20 + i*5)+'mm', '20mm', (24 + i*5)+'mm', '60mm'], contents: "UIColors."+list[i]})
var pstyle = doc.paragraphStyles.add({name: list[i]});
tf.parentStory.appliedParagraphStyle = pstyle;
pstyle.previewColor = UIColors[list[i]];
var guide = doc.guides.add({orientation: HorizontalOrVertical.HORIZONTAL, location:(24 + i*5)+'mm'});
guide.guideColor = UIColors[list[i]];
};
app.activeWindow.overprintPreview = false;
app.activeWindow.screenMode = ScreenModeOptions.PREVIEW_OFF;
doc.textPreferences.enableStylePreviewMode = true;
}
create_guide_with_uicolor_and_style_preview_color(app.documents.add(), UIC);
@milligramme
Copy link
Author

jsxの実行結果のinddのずれをIDMLにして、IDML→inddするとまた色がずれる T_T

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment