1 # SPDX-FileCopyrightText: 2023 Melissa LeBlanc-Williams for Adafruit Industries
3 # SPDX-License-Identifier: MIT
7 ================================================================================
11 **Software and Dependencies:**
14 https://github.com/adafruit/Adafruit_Blinka/releases
16 * Author(s): Melissa LeBlanc-Williams
20 __version__ = "0.0.0+auto.0"
21 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
23 def clamp(value, min_value, max_value):
24 """Clamp a value between a minimum and maximum value"""
25 return max(min(max_value, value), min_value)
28 """Swap the bytes in a 16 bit value"""
29 return (value & 0xFF00) >> 8 | (value & 0x00FF) << 8