I have a small riddle that I can not manage to solve for a good while now!
It is possible to assign colours to values when coding a TV indicator but is it possible to do the opposite - to assign values to colours taken from an other indicator?
In other words, I have an indicator that plots a line and assigns colours to it (the colours can either be #2196f3 or #FF0000). What I would like to do is to have an other indicator below it taking the #colour value and plotting a new line based on that colour. For example if indicator A has turned from #2196f3 to #FF0000, the needed indicator B, changes from 1 to -1.
I have looked throughout the web to find a similar question with an answer but so far no luck ;( I am learning pine script so I apologize if its a silly question with an easy solution.
Thank you for you time!