From 8c65194aeae957d4c4bd6d0ceb4804fbf1451f78 Mon Sep 17 00:00:00 2001 From: Justin Georgi Date: Fri, 22 May 2026 08:33:29 -0700 Subject: [PATCH] Add custom marker color property Signed-off-by: Justin Georgi --- includes/AnnotationHandler.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/AnnotationHandler.php b/includes/AnnotationHandler.php index 3c92fa6..06aac63 100644 --- a/includes/AnnotationHandler.php +++ b/includes/AnnotationHandler.php @@ -141,11 +141,12 @@ class AnnotationHandler extends CodeContentHandler { ); $maskCirc = Html::rawElement('circle',$attrMask); array_push($maskCircles,$maskCirc); + $markColor = isset($annot['color']) ? $annot['color'] : '#ff0000'; $attrMarkerCirc = array( 'cx' => $annot['position']['0'], 'cy' => $annot['position']['1'], 'r' => '3.75', - 'style' => 'fill-opacity: .35; stroke-linejoin: bevel; stroke-width: .3793; stroke: #ff0000;', + 'style' => "fill-opacity: .35; stroke-linejoin: bevel; stroke-width: .3793; stroke: {$markColor};", 'fill' => (isset($annot['light']) && $annot['light']) ? 'white' : 'black' ); $markCirc = Html::rawElement('circle',$attrMarkerCirc); @@ -153,7 +154,7 @@ class AnnotationHandler extends CodeContentHandler { $attrMarkerText = array( 'x' => $annot['position']['0'], 'y' => $annot['position']['1'], - 'style' => 'fill: #ff0000; font-size: 5px; stroke-linejoin: bevel; stroke-width: .6968; text-align: center; text-anchor: middle; transform: translateY(1.5px);' + 'style' => "fill: {$markColor}; font-size: 5px; stroke-linejoin: bevel; stroke-width: .6968; text-align: center; text-anchor: middle; transform: translateY(1.5px);" ); $markText = Html::rawElement('text',$attrMarkerText, isset($annot['label']) ? $annot['label'] : $label ); array_push($markers,$markText);