fromJson
Parses a segment from its JSON object representation.
Expects a required "color" string ("#RRGGBB" or "#AARRGGBB") and an optional "length" (defaults to 1).
Return
the parsed segment
Parameters
json
the segment JSON object
Throws
JSONException
if the required "color" field is missing (an unparseable color value raises an unchecked IllegalArgumentException)