def METHOD_NAME(*, db_session, incident_severity_in: IncidentSeverityCreate) -> IncidentSeverity:
    """Creates an incident severity."""
    project = project_service.get_by_name_or_raise(
        db_session=db_session, project_in=incident_severity_in.project
    )
    incident_severity = IncidentSeverity(
        **incident_severity_in.dict(exclude={"project", "color"}), project=project
    )
    if incident_severity_in.color:
        incident_severity.color = incident_severity_in.color.as_hex()
    db_session.add(incident_severity)
    db_session.commit()
    return incident_severity