Determining that in RGB can be complicated, but you can convert a RGB value into HSV, a format that represents colors by Hue, Saturation and Value. This is the system used to pick specific colors in software like Photoshop.
In this system all colors of the spectrum are represented in a single floating pointer number (Hue) that ranges from 0 to 360 degrees, the other 2 numbers only modify this color (tell if it's grayer or brighter).
This makes it easy to compare colors, as you can see on this image every primary color in both the RGB and CMYK systems are exactly 60 degrees apart.
Here you can easily tell that anything between 30 and 90 is a tone of yellow, anything between 330 (or -30) and 30 is a tone of red and so on.
You can even be more specific and determine ranges for tones of orange, purple, and other colors that are not primary.
About black and white, you can determine if a color appears black by checking if it's Value is low, say less than 0.1 for instance (it ranges from 0 to 1), and if it's white if you find the combination of high Value (bigger than 0.9 for instance) and low Saturation (lower than 0.1 for instance). There are no exact numbers of course, so you will have to decide for yourself when a very dark or very bright color becomes black or white.