From 808b71832e499c90953cd678ecfcaa43d4733210 Mon Sep 17 00:00:00 2001 From: Tom Najdek Date: Thu, 13 May 2021 21:47:03 +0200 Subject: [PATCH] Fix rgb to hex color conversion --- chrome/content/zotero/import/mendeley/mendeleyImport.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/import/mendeley/mendeleyImport.js b/chrome/content/zotero/import/mendeley/mendeleyImport.js index fb79a101e9..a70ee386f4 100644 --- a/chrome/content/zotero/import/mendeley/mendeleyImport.js +++ b/chrome/content/zotero/import/mendeley/mendeleyImport.js @@ -847,7 +847,9 @@ Zotero_Import_Mendeley.prototype._getDocumentAnnotationsAPI = async function (gr const annotation = { id: a.id, - color: a.color ? `#${a.color.r.toString(16)}${a.color.g.toString(16)}${a.color.b.toString(16)}` : null, + color: a.color + ? `#${a.color.r.toString(16).padStart(2, '0')}${a.color.g.toString(16).padStart(2, '0')}${a.color.b.toString(16).padStart(2, '0')}` + : null, dateAdded: a.created, dateModified: a.last_modified, hash: a.filehash,