when I put gradient on a shape( for ex. a rectangle) between the two main colors a grayish color appears.
in one image its the screen of my pc that there is a gray color between black and white. the other image is the correct gradient from internet!
I'll be glad to solve my problem.
By default, Black is the darkest point in Grayscale mode. So, in the middle of the color transition we have a point where color becomes weaker and gray becomes stronger. To solve this, add some color (in this case, red) to your black color stop. For example, in Color Picker use Red Hue and the right-bottom corner (Saturation = 100, Brightness = 0 or 1)
You can also ditch the CMYK workflow and change the Document Color Mode to RGB if you're not setting up artwork for digital printing.
I agree with ZooN that if you wish to match something from the internet, RGB will be the obvious choice; and with the reservation about print, of course.
And I agree with Anna that in CMYK you need to avoid the greying of the colour. My own preference is to use the same CMY values at both stops and just add K on the dark side.