Standardize Floating Menu Alpha to a Normalized 0–1 Range

Describe the bug

When updating a floating menu item’s background color using BTTMenuItemBackgroundColor, the color string is specified as four comma-separated values (e.g. '0,0,20,255'). Here, the alpha component is expected to be an integer between 0 and 255. However, many developers and APIs follow the standard convention of a normalized alpha value between 0 and 1. I propose that BTT be updated so that the alpha value conforms to this standard, allowing users to specify the alpha component as a float between 0 and 1. This change would align BTT with common practices, reduce the need for manual conversions, and minimize potential confusion.

Question, how could this be implemented and not cause backward compatibility issues?


Device information:

  • Device: MacBook Pro (14-inch, 2021)
  • macOS: 15.3 (24D60)
  • BTT Version: 5.168 (2025020212)
  • Alpha: 0 update(s) behind latest Alpha version 5.168 (2025020212).
  • Regular: Installed version is ahead of latest Regular version 5.140.

Additional information (e.g. crash logs, related issues, etc.):

I came across this bug when developing the Color Picker widget.

ah yes, for the simple json fromat I already allow to use the css style rgba() definition, I'll add the same to the standard color parsing so something like this will start working:

tell application "BetterTouchTool"
	update_menu_item "E3907199-767B-46AF-9EF5-ED4F55C2F180" json "{BTTMenuItemBackgroundColor: 'rgba(255, 99, 71, 0.5)', BTTMenuItemText: 'test' }" with persist
end tell
1 Like

should work in 5.169 alpha (uploading now) (btw. it also supports hex like #00aabb (rgb) or #00aabbff (rgba)

2 Likes