def radec2deg(ra='', dec=''):
    """ Convert right ascension/declination from strings to decimal degrees.

    Takes RA and/or Dec from strings in HH:MM:SS format and DD:MM:SS,
    respectively. Each coordinate is converted to a decimal degrees float.
    In case both parameters are provided, it returns a tuple.
    """
    dec_deg = None
    ra_sign = 1
    ra_deg = None
    dec_sign = 1

    if dec:
        degs, mins, secs = [float(i) for i in dec.split(sep=':')]
        if str(degs)[0] == '-':
            dec_sign = -1
            degs = abs(degs)
        dec_deg = dec_sign * (degs + (mins / 60) + (secs / 3600))

    if ra:
        hours, mins, secs = [float(i) for i in ra.split(':')]
        if str(hours)[0] == '-':
            ra_sign, hours = -1, abs(hours)
        deg = (hours * 15) + (mins / 4) + (secs / 240)
        ra_deg = deg * ra_sign

    if ra and dec:
        return ra_deg, dec_deg
    else:
        return ra_deg or dec_deg