Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions pydantic/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,8 @@ def float_to_255(c: float) -> int:

Returns:
The integer equivalent of the given float value rounded to the nearest whole number.

Raises:
ValueError: If the given float value is outside the acceptable range of 0 to 1 (inclusive).
"""
return int(round(c * 255))
return round(c * 255)


COLORS_BY_NAME = {
Expand Down
Loading