BackgroundColor limits white drawing color
Forums › ProRealTime English forum › ProBuilder support › BackgroundColor limits white drawing color
- This topic has 4 replies, 2 voices, and was last updated 7 years ago by AVT.
-
-
07/18/2017 at 7:21 PM #41028
Graphical instructions together with BackgroundColor have a funny limit: No matter what BG color you set, lines and text on that background are limited to a very bright gray but can not be white. This is what I found: at least two of the color values must be not higher than 235 (then the third color can have 255). Bug?
Code for Tests:
Background color with white text123456BACKGROUNDCOLOR(0,0,0) // color unimportantR=235 // 1st 235G=235 // 2nd 235B=255 // last can have 255DrawText("■",barindex,0,Monospaced,Bold,16) coloured(R,G,B)Return07/19/2017 at 9:20 AM #41048That’s not a bug, this is intentional, it is not possible to set a color brighter or darker than the actual background color. It was already the case with the color panel in the indicator setting, setting a dark gray color when you have a very dark background reverse the color to a brighter one. I know this is annoying when you want to plot something almost transparent… already discussed with IT finance team, I just add this query to my own wish list into the dedicated thread: https://www.prorealcode.com/topic/centralization-of-queries-and-suggestions-on-prorealtime/page/8/#post-41047
07/19/2017 at 1:10 PM #41075I tried automatic inverting the colors when a user changes the background color. But here I am really lost, how a general formula should look like which works around these limits. Well for now it’s just one line and found a simple solution. (And for transparency we have the Alpha value now, great to use).
Thanks Nicolas.
07/19/2017 at 1:44 PM #4108107/20/2017 at 11:52 AM #41150Yes, you can completely fade out color. Example here:
Background black, Text color white (well not really completely bright white, but as far as we can go) and then fading out with Alpha. Code:
Fade out to invisible1234567891011121314151617BACKGROUNDCOLOR(0,0,0) // color unimportantR=235 // 1st 235G=235 // 2nd 235B=255 // last can have 255Fade0=255 // brightFade1=128 // bit lessFade2=64 // more lessFade3=32 // even more lessFade4=0 // invisibleDrawText("■",barindex,0.4,Monospaced,Bold,30) coloured(R,G,B,Fade0)DrawText("■",barindex,0.2,Monospaced,Bold,30) coloured(R,G,B,Fade1)DrawText("■",barindex,0,Monospaced,Bold,30) coloured(R,G,B,Fade2)DrawText("■",barindex,-0.2,Monospaced,Bold,30) coloured(R,G,B,Fade3)DrawText("■",barindex,-0.4,Monospaced,Bold,30) coloured(R,G,B,Fade4)Return -
AuthorPosts
Find exclusive trading pro-tools on