many changes
This commit is contained in:
12
gradientmesh/util.py
Normal file
12
gradientmesh/util.py
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env ipython
|
||||
def clamp(val, low, high):
|
||||
return min(high, max(low, val))
|
||||
|
||||
|
||||
def rgb2hex(r, g, b, a=None):
|
||||
hex_value = "#{:02x}{:02x}{:02x}".format(
|
||||
int(r * 255),
|
||||
int(g * 255),
|
||||
int(b * 255)
|
||||
)
|
||||
return hex_value
|
Reference in New Issue
Block a user