feat: 新增 --night-mode 夜间模式(蓝光衰减)支持#5
Merged
Merged
Conversation
新增 --night-mode 参数,通过伽马校正表衰减蓝光通道实现夜间模式。 支持 light(20%)/medium(50%)/heavy(80%) 预设及 0.0-1.0 数值强度, 不带 --output 时批量设置所有显示器。 - gamma.py: 新增 set_night_mode() 核心函数 - api.py: 重新导出 set_night_mode - cli/parser.py: 新增 --night-mode 参数 - cli/handlers.py: 新增 _handle_night_mode 处理函数 - cli/__init__.py: 接入调度与全局操作分支 - cli/common.py: 加入 _MOD_OP_ATTRS - __init__.py: 导出 set_night_mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更内容
新增
--night-mode参数,利用现有的SetDeviceGammaRampAPI 实现蓝光衰减,原理与 f.lux 相同。用法
涉及文件
winrandr/features/gamma.py— 新增set_night_mode()核心函数winrandr/api.py— 重新导出set_night_modewinrandr/cli/parser.py— 新增--night-mode参数定义winrandr/cli/handlers.py— 新增_handle_night_mode处理函数winrandr/cli/__init__.py— 接入调度与全局操作分支winrandr/cli/common.py— 加入_MOD_OP_ATTRSwinrandr/__init__.py— 导出set_night_mode测试
ruff check .— 通过(新增代码无 lint 错误)pytest tests/ -q— 400 passed(全部通过)