Random Color Generator

  • Share this:

Code introduction


This function generates a random color in hexadecimal format.


Technology Stack : Python

Code Type : Python Function

Code Difficulty : Intermediate


                
                    
import random

def random_color():
    return f"#{random.randint(0, 0xFFFFFF):06x}"                
              
Tags: