The function of decomposing color into shades. - page 10

 
Реter Konow:

Nikolai, that sounds like kindergarten. The statement "4 times faster" is not valid, because it is not proven.


  1. Comment out the line in your version of my solution on MT5 and you will see the difference.

This line affects the drawing of the whole rectangle for some reason. But it's not my glitch. Check it out.

Continuing to look into those glitches you've got. I want to see if it's really because of my algorithm.


And turn off the unnecessary flickering of numbers. Take out all the unnecessary stuff. Let a simple rectangle with a gradient of one original colour be displayed once. No unnecessary gimmicks.

Peter, I wrote "4 times faster" after I provided the code with proofs. I don't understand what else is needed.

I've turned everything off - the glitch continues. I saw this glitch before I even made this dodger. If you insert my gradient, this glitch isn't there even with the textual overhang. This is already demonstrated by me in the code attached in this post.

 
Yury Kulikov:

I'll join the 'accusations', couldn't take it :)

A good example of how not to program. If this is how your entire GUI is written, we won't be seeing it for a while. :(

Every line is a "masterpiece": such a pile of errors and bloopers, so much hope that mql4 will work out. I now understand why mt4 is being used.

I think that publishing of such codes and the subsequent reaction to criticism is not respecting the forum audience. They don't want to do you harm, they want to help you.

As for comparing algorithms, you can compare them visually. It's not like you offered proof in numbers that your algorithm gives shades 99% close to "windows shades".

On the left is sort of your approach, on the right isNikolai Semko's. (A modified NikolaiSemko script was used).


Did you take this script? Did you install it on MT4? Checked it? Did you compare it? (They all are eager to join in the accusations))).

As for the script - it's not my algorithm. Nikolai modified it without knowing how. He's the one to talk to about these pictures.

 
Nikolai Semko:
Generally speaking, a function to get an array of gradients between two colours is more useful. As it's simpler and more useful in practice.

If you need a gradient of one colour to white or to black, you can get them that way with this function.


I told you so. Turn off unnecessary flickering. Output a single rectangle. You have a drawing problem there that has nothing to do with my algorithm. I pointed it out to you. Work it out.

 
Реter Konow:

I told you so. Turn off the unnecessary flickering. Output a single rectangle. You have a drawing problem there that has nothing to do with my algorithm. I pointed it out to you. Figure it out.

Peter, enough with the words. Prove it with the code with visualization, as I did. I repeat, I haven't changed your function, but only pulled a uint value from it instead of a string.
Please provide me with the working example of your function without strings in MQL5 at last!

 
Yury Kulikov:

I'll join the 'accusations', couldn't take it :)

A good example of how not to program. If this is how your entire GUI is written, we won't be seeing it for a while. :(

Every line is a "masterpiece": such a pile of errors and bloopers, so much hope that mql4 will work out. I now understand why mt4 is being used.

I think that publishing of such codes and the subsequent reaction to criticism is not respecting the forum audience. They don't want to do you harm, they want to help you.

As for comparing algorithms, you can compare them visually. It's not like you offered proof in numbers that your algorithm gives shades 99% close to "windows shades".

On the left is sort of your approach, on the right isNikolai Semko's. (A modified NikolaiSemko script was used).


Why are you putting up these gifs? Do you want to make an impression? Alas, you'll have to try harder. I'm too sophisticated in graphics. Better take my algorithm, put it on mt4 and print the colours. Then, check against the colour palette, esteemed MENTOR.

 
Nikolai Semko:

Peter, enough with the words. Prove with code with visualization, as I did. I repeat: I did not change your function, but only pulled uint value from it instead of string

I am in process of translation of my code to MT5. I will show you when I finish.

 
Nikolai Semko:
Generally speaking, the function to get an array of gradients between two colours is more useful.

It would probably be a little faster that way:

void Gradient(uint clr1,uint clr2,uint &arr[],uint size)
  {
   if(size==0) return;
   ArrayResize(arr,size);
   rgb c1,c2;
   c1.clr=clr1;
   c2.clr=clr2;
   double R1=c1.c[2],G1=c1.c[1],B1=c1.c[0];
   double R2=c2.c[2],G2=c2.c[1],B2=c2.c[0];
   double deltaR=(R2-R1)/(size-1);
   double deltaG=(G2-G1)/(size-1);
   double deltaB=(B2-B1)/(size-1);
   R1 += 0.4999;
   G1 += 0.4999;
   B1 += 0.4999;
   for(uint i=0;i<size;i++)
     {
      R1+=deltaR; c1.c[2]=uchar (R1);
      G1+=deltaG; c1.c[1]=uchar (G1);
      B1+=deltaB; c1.c[0]=uchar (B1);
      arr[i]=c1.clr;
     }
  }
 
Nikolai Semko:

Peter, enough with the words. Prove with code with visualization, as I did. I repeat - I did not change your function, but only pulled uint value from it instead of string

Why don't you check it against the colour palette? Is it really so hard?

And why does commenting a line with text output change the drawing of the whole rectangle?

 
Реter Konow:

Why don't you check with the colour palette? How hard can it be?

You could at least throw in a link or something. What to compare it to.

 
All the glitches seem to have occurred when I switched to MT5. There is nothing like that on MT4. The demanding nature of MT5 is much higher, which creates problems. But that doesn't mean that the solution is no good. You just need to tweak the code.