命令行颜色换算器(基于python)

import sys
print(hex(int(sys.argv[1])<<16|int(sys.argv[2])<<8|int(sys.argv[3])))

就两行代码

在mac上可以在.bash_profile中加入一个方法

function ccolor {
python /Users/xirtam/Documents/tools/ccolor.py $1 $2 $3
}

修改后记得要source

source ~/.bash_profile

使用效果

posted @ 2017-05-07 16:20  带狗狗带  Views(161)  Comments(0Edit  收藏  举报