Get object rotation for x axis in degrees (360)

there are several questions like this but none has the correct answer.
I found:

transform.localEulerAngles.x
transform.eulerAngles.x

but they will just return the flipped value at 90 degrees or something…

what is the correct answer ?

a function would be useful, with input (axis:String, rotation:Vector3) and output 360 degree angle…

so basically heres the input and output needed (I observed the values by just dragging the x rotation gizmo on a brand new gameobject):

getRealRotation("x", Vector3(60,0,0)) => 60
getRealRotation("x", Vector3(70,0,0)) => 70
getRealRotation("x", Vector3(80,0,0)) => 80
getRealRotation("x", Vector3(90,0,0)) => 90
getRealRotation("x", Vector3(80,-180,-180)) => 100
getRealRotation("x", Vector3(70,-180,-180)) => 110

Transform.eulerAngles is derived from the Transform.rotation, a Quaternion. It is not stored independently. There are multiple euler angle representations for any given physical rotation, and the representation does not remain constant throughout all rotations. Assuming you are doing the rotation through manipulating the Transform, then the usual solutions is to maintain your own Vector3 and treat eulerAngles as write-only. That is, you execute whatever rotation code to the Vector3 first, then you assign that Vector3 to eulerAngles. That way your Vector3 will always be in a format that you control.

In situations where this cannot be done (like when using a Rigidbody and forces), you need to create a point of reference and calculate the angle yourself. This question creates a HUD display for a plane and calculates the pitch, roll, and skew.

http://answers.unity3d.com/questions/696271/how-create-modern-aircrafts-hud.html