Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Gradient Color

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

    Gradient Color

    In Nt7 when I try to use the Color.FromRgb(Convert.ToByte(bValue1),Convert.ToBy te(bValue2),Convert.ToByte(bValue3)) method, the compiler doesn't recognize it. The error message says, "System.Drawing.Color does not contain a definition for 'FromGrb' ". How do I get and set color values using Rgb? I want to use this to create a color gradient.

    #2
    Hello,

    Thank you for the question.

    If this is a copy of the code you are using, the reason would just be a spelling error.

    The method is FromArgb but you are using FromRgb.

    Creates a Color structure from the four 8-bit ARGB components (alpha, red, green, and blue) values.


    I look forward to being of further assistance.

    Comment


      #3
      Thanks, that worked. What method would I use to get an Argb value for the colors that are built-into NinjaScript?

      Comment


        #4
        Hello,

        The answer to this was actually already provided in the MSDN link in post #2, on the left you will see the additional Method that Color has, ToArgb is one of those methods.

        Otherwise, this is the standard reference which shows the ARGB of each C# color: https://msdn.microsoft.com/en-us/lib...or=-2147217396

        Please let me know if I may be of further assistance.

        Comment


          #5
          Thank you. I have a beautiful gradient color indicator now.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          475 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          315 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          253 views
          1 like
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          340 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          305 views
          0 likes
          Last Post CarlTrading  
          Working...
          X