allpy
changeset 660:b5a5f46a48a7
blocks3d/www: proportional brightness of conservative columns and the rest of block
author | boris <bnagaev@gmail.com> |
---|---|
date | Wed, 29 Jun 2011 12:46:28 +0400 |
parents | 720c15589a90 |
children | 13a4e974bb68 |
files | blocks3d/www/input/crc32_color.js |
diffstat | 1 files changed, 5 insertions(+), 6 deletions(-) [+] |
line diff
1.1 --- a/blocks3d/www/input/crc32_color.js Wed Jun 29 11:55:16 2011 +0400 1.2 +++ b/blocks3d/www/input/crc32_color.js Wed Jun 29 12:46:28 2011 +0400 1.3 @@ -18,19 +18,18 @@ 1.4 // lighten 1.5 for (j = 0; j < 3; j++) 1.6 { 1.7 + rgb[j] |= 0x80; 1.8 + } 1.9 + for (j = 0; j < 3; j++) 1.10 + { 1.11 if (dark) 1.12 { 1.13 - rgb[j] &= 0x7F; 1.14 - } 1.15 - else 1.16 - { 1.17 - rgb[j] |= 0x80; 1.18 + rgb[j] *= 0.8; 1.19 } 1.20 } 1.21 for (j = 0; j < 3; j++) 1.22 { 1.23 rgb[j] = dechex(rgb[j]); 1.24 - 1.25 if (rgb[j].length == 1) 1.26 { 1.27 rgb[j] = '0' + rgb[j];