✪ rqworker --db 10 default high
16:06:30 RQ worker started, version 0.3.7
16:06:30
16:06:30 *** Listening on default, high...
16:06:49 high: jobs.multiply(5, 2) (2df52ba2-bd32-4849-a8e1-c5241c78b542)
16:06:49 Job OK, result = 10
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
| # Amount should be a decimal between 0 and 1. Lower means darker | |
| def darken_color(hex_color, amount=0.4) | |
| hex_color = hex_color.gsub('#','') | |
| rgb = hex_color.scan(/../).map {|color| color.hex} | |
| rgb[0] = (rgb[0].to_i * amount).round | |
| rgb[1] = (rgb[1].to_i * amount).round | |
| rgb[2] = (rgb[2].to_i * amount).round | |
| "#%02x%02x%02x" % rgb | |
| end | |
OlderNewer