GSoC/GCI Archive
Google Code-in 2012 KDE

Marble Sky: Colors for stars

completed by: Mohammed Nafees

mentors: Torsten Rahn, René Küttner, Dennis Nienhüser

Stars in the sky sometimes show different colors. Some are remarkable red, others blue and yet others yellow, orange or white.

In this task the stars tool is supposed to get extended so that it creates KML icon styles associated to these colors.

The key to this task is the so called color index:

http://en.wikipedia.org/wiki/Color_index

For reference there are some (B-V)-Color indexes listed here - including the supposed RGB value that they should get rendered with:

B-V value  Example                  Color             RGB value used in Marble (hex):

-0.23        Spica (Alp Vir)          blue               #a0b8f9

±0.00       Rigel (Bet Ori)          blue-white      #b9cbf9

+0.09       Deneb (Alp Ori)        white              #ffffff

+0.80       Capella  (Alp Aur)     yellow             #f8f9cc

+1.23       Arcturus (Alp Boo)    orange            #f8f0cc

+1,85       Betelgeuse (Alp Ori) red                 #ffe5d3

+2.35       Mu  Cep                  garnet red       #e8bc95

These B-V values can also be found in the catalog.dat file of the star catalog.

The most naive approach (with good results) would always draw assign the pixmap that is closest to the B-U color value (without doing interpolation).

In the end the stars plugin should show all stars in color.

This task will make the sky look a bit more "realistic" for bright stars:

The following star pixmaps are directly related to the colors specified inside http://www.google-melange.com/gci/task/view/google/gci2012/8079206 :

http://devel-home.kde.org/~tackat/star_0_blue.png

http://devel-home.kde.org/~tackat/star_0_bluewhite.png

http://devel-home.kde.org/~tackat/star_0_white.png

http://devel-home.kde.org/~tackat/star_0_yellow.png

http://devel-home.kde.org/~tackat/star_0_orange.png

http://devel-home.kde.org/~tackat/star_0_red.png

http://devel-home.kde.org/~tackat/star_0_garnetred.png

These pixmaps should be drawn unmodified at the same size for stars of the respective color with a magnitude < -1 mag (e.g. Sirius). Just use "nearest neighbor" approach to identify the right pixmap color. Ideally the mapping is done in the stars.dat file already (to save performance).

For stars with a magnitude < 0 (and >= -1) the pixmaps should be smooth-scaled (with Gimp) down to 90% of the original size.

For stars with a magnitude < 1 (and >= 0) the pixmaps should be smooth-scaled down to 80% of the original size.

For stars with a magnitude < 2 (and >= 1) the pixmaps should be smooth-scaled down to 70% of the original size.

For magnitude < 3 (and >=2) there's a separate set of pixmaps:

http://devel-home.kde.org/~tackat/star_3_blue.png

http://devel-home.kde.org/~tackat/star_3_bluewhite.png 

http://devel-home.kde.org/~tackat/star_3_garnetred.png

http://devel-home.kde.org/~tackat/star_3_orange.png 

http://devel-home.kde.org/~tackat/star_3_red.png 

http://devel-home.kde.org/~tackat/star_3_white.png 

http://devel-home.kde.org/~tackat/star_3_yellow.png
 
These get scaled down in 10% steps as well with lower magnitudes:
 
mag 3 = 100%
mag 4 = 90%
mag 5 = 80 %
mag 6 = 70
mag 6 = 60
 
For all magnitudes and all colors pixmaps should get created and scaled that can then be used inside the KML file. And get properly assigned.