There is a code in which the color of the block is randomly generated.

function random_html_color() { return sprintf('#%02X%02X%02X', rand(230, 255), rand(230, 255), rand(230, 255)); } 

Will it be wrong to say that RGB color is generated in the range from 230 to 255? After all, if it does, then there will be no color blocks, but only shades of gray.
How to correctly say what is generated, as it were, every sub-color in this range, for example, only R or G (in context, everything about 3 is needed)?

  • Calling the rand function returns a unique value each time (in theory). In practice, this code will be insufficient because the calls go one by one and the values ​​are unlikely to be unique. - Daniel Protopopov
  • And the question is what? How to call chtoli? - Alexey Shatrov
  • Tell us how are you going to generate each sub-color with this code? If rand always returns a pseudo-random value, it means that for a million calls to this function, it can return both a random set of RGB values ​​from a range and all the time one and the same set of values. Describe the task correctly, what you want to achieve, you can add an approximate result of how it should look. - fens
  • I mean how to correctly name each individual color from RGB, namely R, G and B. I need to write something like this: "RGB color is generated randomly separately for each (th) ...". - Escaper

0