import orbital.constants as oc


class Body:
    def __init__(self, mass, mu, mean_radius, equatorial_radius, polar_radius, apoapsis_names, periapsis_names):
        self.mass = mass
        self.mu = mu
        self.mean_radius = mean_radius
        self.equatorial_radius = equatorial_radius
        self.polar_radius = polar_radius
        self.apoapsis_names = apoapsis_names
        self.periapsis_names = periapsis_names

    def altitude(self, radius):
        return radius - self.mean_radius

    def orbital_radius(self, altitude):
        return altitude + self.mean_radius

    @property
    def apoapsis_names(self):
        return self._apoapsis_names

    @apoapsis_names.setter
    def apoapsis_names(self, value):
        if isinstance(value, str):
            self._apoapsis_names = [value]
        else:
            self._apoapsis_names = value

    @property
    def periapsis_names(self):
        return self._periapsis_names

    @periapsis_names.setter
    def periapsis_names(self, value):
        if isinstance(value, str):
            self._periapsis_names = [value]
        else:
            self._periapsis_names = value


earth = Body(
    mass=oc.earth_mass,
    mu=oc.earth_mu,
    mean_radius=oc.earth_radius_mean,
    equatorial_radius=oc.earth_radius_equatorial,
    polar_radius=oc.earth_radius_polar,
    apoapsis_names='apogee',
    periapsis_names='perigee'
)

mercury = Body(
    mass=oc.mercury_mass,
    mu=oc.mercury_mu,
    mean_radius=oc.mercury_radius_mean,
    equatorial_radius=oc.mercury_radius_equatorial,
    polar_radius=oc.mercury_radius_polar,
    apoapsis_names='aphermion',
    periapsis_names='perihermion'
)

venus = Body(
    mass=oc.venus_mass,
    mu=oc.venus_mu,
    mean_radius=oc.venus_radius_mean,
    equatorial_radius=oc.venus_radius_equatorial,
    polar_radius=oc.venus_radius_polar,
    apoapsis_names=['apocytherion', 'apocytherean', 'apokrition'],
    periapsis_names=['pericytherion', 'pericytherean', 'perikrition']
)

mars = Body(
    mass=oc.mars_mass,
    mu=oc.mars_mu,
    mean_radius=oc.mars_radius_mean,
    equatorial_radius=oc.mars_radius_equatorial,
    polar_radius=oc.mars_radius_polar,
    apoapsis_names='apoareion',
    periapsis_names='periareion'
)

jupiter = Body(
    mass=oc.jupiter_mass,
    mu=oc.jupiter_mu,
    mean_radius=oc.jupiter_radius_mean,
    equatorial_radius=oc.jupiter_radius_equatorial,
    polar_radius=oc.jupiter_radius_polar,
    apoapsis_names=['apozene', 'apojove'],
    periapsis_names=['perizene', 'perijove']
)

saturn = Body(
    mass=oc.saturn_mass,
    mu=oc.saturn_mu,
    mean_radius=oc.saturn_radius_mean,
    equatorial_radius=oc.saturn_radius_equatorial,
    polar_radius=oc.saturn_radius_polar,
    apoapsis_names=['apokrone', 'aposaturnium'],
    periapsis_names=['perikrone', 'perisaturnium']
)

uranus = Body(
    mass=oc.uranus_mass,
    mu=oc.uranus_mu,
    mean_radius=oc.uranus_radius_mean,
    equatorial_radius=oc.uranus_radius_equatorial,
    polar_radius=oc.uranus_radius_polar,
    apoapsis_names='apouranion',
    periapsis_names='periuranion'
)

neptune = Body(
    mass=oc.neptune_mass,
    mu=oc.neptune_mu,
    mean_radius=oc.neptune_radius_mean,
    equatorial_radius=oc.neptune_radius_equatorial,
    polar_radius=oc.neptune_radius_polar,
    apoapsis_names='periposeidion',
    periapsis_names='apoposeidion'
)

@@ -148,19 +148,36 @@
 is_names
+, plot_color=None
 ):%0A
-
         
@@ -432,24 +432,61 @@
 iapsis_names
+%0A        self.plot_color = plot_color
 %0A%0A    def al
@@ -1202,256 +1202,8 @@
 e%0A%0A%0A
-earth = Body(%0A    mass=oc.earth_mass,%0A    mu=oc.earth_mu,%0A    mean_radius=oc.earth_radius_mean,%0A    equatorial_radius=oc.earth_radius_equatorial,%0A    polar_radius=oc.earth_radius_polar,%0A    apoapsis_names='apogee',%0A    periapsis_names='perigee'%0A)%0A%0A
 merc
@@ -1457,24 +1457,50 @@
 perihermion'
+,%0A    plot_color='#ffd8b0'
 %0A)%0A%0Avenus = 
@@ -1813,16 +1813,316 @@
 rition'%5D
+,%0A    plot_color='#d58f41'%0A)%0A%0Aearth = Body(%0A    mass=oc.earth_mass,%0A    mu=oc.earth_mu,%0A    mean_radius=oc.earth_radius_mean,%0A    equatorial_radius=oc.earth_radius_equatorial,%0A    polar_radius=oc.earth_radius_polar,%0A    apoapsis_names='apogee',%0A    periapsis_names='perigee',%0A    plot_color='#4e82ff'
 %0A)%0A%0Amars
@@ -2357,24 +2357,50 @@
 'periareion'
+,%0A    plot_color='#ffc98a'
 %0A)%0A%0Ajupiter 
@@ -2676,16 +2676,42 @@
 rijove'%5D
+,%0A    plot_color='#ff7726'
 %0A)%0A%0Asatu
@@ -2997,16 +2997,42 @@
 urnium'%5D
+,%0A    plot_color='#ffe296'
 %0A)%0A%0Auran
@@ -3285,16 +3285,42 @@
 uranion'
+,%0A    plot_color='#becaff'
 %0A)%0A%0Anept
@@ -3545,24 +3545,24 @@
 poseidion',%0A
-
     periapsi
@@ -3583,11 +3583,37 @@
 seidion'
+,%0A    plot_color='#8da4ff'
 %0A)%0A

Add plot colors to default bodies