Celestial Programming : Star Colors: B-V to RGB Conversion

Many catalogs, such as HIPPARCOS supply a B-V value, from which a star's color may be determined. There is some ambiguity when using RGB values, as everyone's monitor is different, so different methods can produce results that look very different, but both of which are correct. There are many solutions if you search around, they generally fall into one of three categories: 1. Computation from emision spectra, 2. Interpolation based on [1], or 3. a lookup table based on [1]. I provide an example of each, and at the bottom allow you to generate your own code for a lookup table which includes how many ever intervals you desire.

I will not be covering the work of Mitchell Charity's What Color are the Stars?, but mention it here because many other's have based their work off his. He has a Perl program which was used to generate the tables, it was based off of John Walker and his code is used below. Another good resource is Dan Bruton's Color Science page.

Tip: Since the colors do not change, it is possible that the colors be pre-computed for a given catalog and the RGB values stored along with it. So there is no need to compute them at runtime, or to even include these functions in the code.

The three implementations covered here are:

Generate Lookup Code

Algorithm:
Intervals: