Flip label contrast: black text on green (bull), white on maroon (bear)

This commit is contained in:
mindesbunister
2025-10-17 12:15:57 +02:00
parent 01147e373a
commit adc78c0644

View File

@@ -365,9 +365,9 @@ var label flipValLbl = na
if showFlipLevelValue and not na(flipLevel)
if not na(flipValLbl)
label.delete(flipValLbl)
// Use darker red for bear to maximize contrast; green stays readable with white text
// High-contrast: black text on green (bull), white text on maroon (bear)
flipLblBg = flipLineAutoColor ? (trend == 1 ? color.new(color.green, 0) : color.new(color.maroon, 0)) : flipLineCustomCol
flipLblTxt = color.white
flipLblTxt = flipLineAutoColor ? (trend == 1 ? color.black : color.white) : color.white
flipValLbl := label.new(bar_index, flipLevel, text="Flip Level: " + str.tostring(flipLevel, format.mintick),
style=label.style_label_left, color=flipLblBg, textcolor=flipLblTxt, yloc=yloc.price, size=size.tiny)