Created
February 2, 2019 23:24
-
-
Save nmorse/735a86fdea81d6ff716030ffb87af4a4 to your computer and use it in GitHub Desktop.
a start of a color lib for pounce
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
| [{r:0.0 g:0.1 b:0.8}] [c1] def # color 1 | |
| [{r:0.5 g:0.6 b:0.2}] [c2] def # color 2 | |
| [+ 2.0 /] [avg2] def | |
| [+ + 3.0 /] [avg3] def | |
| [r get swap g get swap b get [rollup] dip avg3] [?value] def | |
| [dup | |
| [r get] dip2 rolldown [r get] dip avg2 r set | |
| [g get] dip2 rolldown [g get] dip avg2 g set | |
| [b get] dip2 rolldown [b get] dip avg2 b set [drop drop] dip] [blend] def | |
| c1 ?value | |
| [dup [r set] dip dup [g set] dip dup [b set] dip drop] [!gray] def | |
| !gray | |
| c1 c2 | |
| blend blend |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment