Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Paper2Poster/Paper2Poster
/ clamp255
Function
clamp255
demo/app.py:265–269 ·
view source on GitHub ↗
(x)
Source
from the content-addressed store, hash-verified
263
import
re
264
265
def
clamp255(x):
266
try
:
267
return
max(0, min(255, int(round(float(x)))))
268
except
Exception:
269
return
None
270
271
s = str(val).strip()
272
Callers
2
_parse_rgb
Function · 0.85
to_int
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected