A legislature can endeavor to do that and as long as they show that race was a factor but not the predominant factor for the district then it should be permissible. If the district is strangely shaped connecting disparate areas and race is the predominant factor then it would likely be thrown out like the NC-12 districts of the 1990s.
The 11th circuit in 2002 validated the apportionment plan passed by that legislature. In doing so, they noted that the 3rd district (now the 5th) was reasonably compact, and was intentionally drawn with the reasonable purpose of giving the black population 1 district in North Florida. That case never reached the Supreme Court. The membership of the Supreme Court has mostly cycled over since the 1990s in any case.