From 9c5f0c0d6f36a78aa3366902f0af2076ac33e731 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 16 Apr 2020 10:36:51 +0200 Subject: [PATCH] Use rgba instead of #RRGGBBAA for the author markers --- www/code/markers.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/code/markers.js b/www/code/markers.js index 4ae555b31..4fedd6dfc 100644 --- a/www/code/markers.js +++ b/www/code/markers.js @@ -6,7 +6,7 @@ define([ ], function (Util, SFCodeMirror, Messages, ChainPad) { var Markers = {}; - var MARK_OPACITY = 90; + var MARK_OPACITY = 0.5; Messages.cba_writtenBy = 'Written by {0}'; // XXX @@ -15,10 +15,12 @@ define([ var author = Env.authormarks.authors[uid] || {}; uid = Number(uid); var name = Util.fixHTML(author.name || Messages.anonymous); + var col = Util.hexToRGB(author.color); + var rgba = 'rgba('+col[0]+','+col[1]+','+col[2]+','+Env.opacity+');'; return Env.editor.markText(from, to, { inclusiveLeft: uid === Env.myAuthorId, inclusiveRight: uid === Env.myAuthorId, - css: "background-color: " + author.color + Env.opacity, + css: "background-color: " + rgba, attributes: { title: Env.opacity ? Messages._getKey('cba_writtenBy', [name]) : undefined, 'data-type': 'authormark',