forked from Ponysearch/Ponysearch
[mod] random answerer: add random hex color generator
This commit is contained in:
parent
b0d2cd5ca9
commit
5a5cfc1930
1 changed files with 6 additions and 0 deletions
|
@ -38,12 +38,18 @@ def random_uuid():
|
||||||
return str(uuid.uuid4())
|
return str(uuid.uuid4())
|
||||||
|
|
||||||
|
|
||||||
|
def random_color():
|
||||||
|
color = "%06x" % random.randint(0, 0xFFFFFF)
|
||||||
|
return f"#{color.upper()}"
|
||||||
|
|
||||||
|
|
||||||
random_types = {
|
random_types = {
|
||||||
'string': random_string,
|
'string': random_string,
|
||||||
'int': random_int,
|
'int': random_int,
|
||||||
'float': random_float,
|
'float': random_float,
|
||||||
'sha256': random_sha256,
|
'sha256': random_sha256,
|
||||||
'uuid': random_uuid,
|
'uuid': random_uuid,
|
||||||
|
'color': random_color,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue