Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

BRUSHES -> RGB specific example

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    BRUSHES -> RGB specific example

    Hello. I have a specific code example which I need to change. It uses the color "LightSkyBlue" and I need to change that into a specific RGB code. What I need is the code not an explanation, because I am not a good programmer.

    Here is the original code:

    RenderTarget.FillRectangle(new RectangleF(x,y, (float)(chartControl.BarWidth * 2), (float)(rectangleOffset)), Brushes.LightSkyBlue.ToDxBrush(RenderTarget));


    The goal is to change LightSkyBlue into RGB(100,50,245)

    Hope somebody can help.

    #2
    Hello CYDFSN23,

    Thanks for opening the thread and welcome to our support forums!

    What you are attempting to do is replace a predefined SolidColorBrush with your own custom SolidColorBrush.

    You could create your own custom SolidColorBrush and use that instead of Brushes.LightSkyBlue.

    Here is an example:

    Code:
    Brush myBrush = new SolidColorBrush(Color.FromRgb(100, 50, 245));
    Please let me know if you have any additional questions.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DavidHP, Today, 07:56 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by kujista, Today, 06:23 AM
    3 responses
    6 views
    0 likes
    Last Post kujista
    by kujista
     
    Started by Mindset, Yesterday, 02:04 AM
    2 responses
    18 views
    0 likes
    Last Post NinjaTrader_RyanS  
    Started by f.saeidi, Today, 08:03 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by samish18, 04-17-2024, 08:57 AM
    15 responses
    53 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X