jlegewie / zotfile

Zotero plugin to manage your attachments: automatically rename, move, and attach PDFs (or other files) to Zotero items, sync PDFs from your Zotero library to your (mobile) PDF reader (e.g. an iPad, Android tablet, etc.), and extract PDF annotations.
4.06k stars 282 forks source link

annotation color management #484

Open mlana opened 4 years ago

mlana commented 4 years ago

in the prefs, pref("extensions.zotfile.pdfExtraction.colorCategories", '{"Black": "#000000", "White": "#FFFFFF", "Gray": "#808080", "Red": "#FF0000", "Orange": "#FFA500", "Yellow": "#FFFF00", "Green": "#00FF00", "Cyan": "#00FFFF", "Blue": "#0000FF", "Magenta": "#FF00FF"}'); it is not clear how to manage the color names and the color codes and how a specific color used to highlight a passage is 'matched' the the above colors. i would like to be able to add a new color and/or to define a new color code for an existing color name, but my trials and errors remain ...at the stage of errors: that is i get nothing. best maurizio

simull commented 3 years ago

Hi there, I have the same issue. Instead of displaying the name of the color in brackets, I would like to assign a different name.

As long as I cannot manage to assign other names, I would like to drop the names alltogether so that the text is highlighted in the background but no color is mentioned in brackets. Is there currently a way to do that in the settings?

Thanks and best wishes.

sar48 commented 3 years ago

Note: also posted on Zotero zotfile discussion - I'm not sure which is checked most. Apologies for the duplication.

Hi - thanks for this great program, I like it a lot & I think I will be using this a lot!!!

Is there a reason there are only 9 colors? I was highlighting in Adobe which has the possibility for a lot more colors, but they were getting grouped (green + light green, for example)

I tried increasing then number of colors in the code, by editing it as instructed by the site: https://forum.obsidian.md/t/more-zotfile-hacks-extract-underlines-and-change-remove-title-and-color-names/21051

I found the color section and increased the number of color steps (though not with great naming) // define color category based on HSL if (l < 0.12) return "Black"; if (l > 0.98) return "White"; if (s < 0.2) return "Gray"; if (h < 15) return "Red"; if (h < 30) return "RedOrange"; if (h < 45) return "Orange"; if (h < 55) return "YellowOrange"; if (h < 65) return "Yellow"; if (h < 85) return "YellowGreen"; if (h < 125) return "BrightGreen"; if (h < 155) return "MintGreen"; if (h < 170) return "Green"; if (h < 180) return "GreenCyan"; if (h < 190) return "Cyan"; if (h < 230) return "RoyalBlue"; if (h < 270) return "Blue"; if (h < 300) return "Lavender"; if (h < 335) return "Magenta"; return "Red";

I also changed the labels in the options {"Black": " #000000", "White": " #FFFFFF", "Gray": " #808080", "Red": " #FF0000", "RedOrange": " FF5500", "Orange": " #FFA500", "YellowOrange": " #FFD500", "Yellow": " #FFFF00", "YellowGreen": " #AAFF00", "BrightGreen": " #00FF00", "MintGreen": " #00FF80", "Green": " #00FFAA", "GreenCyan": " #00FFEA", "Cyan": " #00FFFF", "RoyalBlue": " #0055FF", "Blue": " #0000FF", "Lavender": " #AA00FF", "Magenta": " #FF00FF"}

I can install zotfile & it is recognized as such, but no longer extracts highlighted annotations, even when I toggle the color options to false.

Anyway, it still works when I re-install the original file, so I can go back to only 9 colors if what I am trying is not really feasible.

Thanks for a great program!