equal
deleted
inserted
replaced
1585 |
1585 |
1586 transparent |
1586 transparent |
1587 "return the transparent-color" |
1587 "return the transparent-color" |
1588 |
1588 |
1589 Transparent isNil ifTrue:[ |
1589 Transparent isNil ifTrue:[ |
1590 Transparent := TranslucentColor red:0 green:0 blue:0. |
1590 Transparent := TranslucentColor scaledRed:0 scaledGreen:0 scaledBlue:0. |
1591 Transparent setAlphaByte:0. |
1591 Transparent setAlphaByte:0. |
1592 ]. |
1592 ]. |
1593 ^ Transparent |
1593 ^ Transparent |
1594 |
1594 |
1595 " |
1595 " |
4457 "Modified: 23.4.1996 / 13:39:50 / cg" |
4457 "Modified: 23.4.1996 / 13:39:50 / cg" |
4458 ! ! |
4458 ! ! |
4459 |
4459 |
4460 !Color methodsFor:'instance creation'! |
4460 !Color methodsFor:'instance creation'! |
4461 |
4461 |
|
4462 alpha:alphaValue |
|
4463 "return a new color with the same color, but different alpha as the receiver" |
|
4464 |
|
4465 alphaValue = 1 ifTrue:[ ^ self]. |
|
4466 ^ (TranslucentColor |
|
4467 scaledRed:red |
|
4468 scaledGreen:green |
|
4469 scaledBlue:blue) alpha:alphaValue |
|
4470 |
|
4471 " |
|
4472 Color red alpha:0.5 |
|
4473 " |
|
4474 ! |
|
4475 |
4462 blendWith:aColor |
4476 blendWith:aColor |
4463 "create a new color from equally mixing the receiver |
4477 "create a new color from equally mixing the receiver |
4464 and the argument, aColor. |
4478 and the argument, aColor. |
4465 Mixing is done by adding components |
4479 Mixing is done by adding components |
4466 (which is different from mixing colors on paper .. which is subtractive)." |
4480 (which is different from mixing colors on paper .. which is subtractive)." |
4896 ! ! |
4910 ! ! |
4897 |
4911 |
4898 !Color class methodsFor:'documentation'! |
4912 !Color class methodsFor:'documentation'! |
4899 |
4913 |
4900 version |
4914 version |
4901 ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.139 1999-10-06 22:26:32 cg Exp $' |
4915 ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.140 1999-10-06 22:56:20 cg Exp $' |
4902 ! ! |
4916 ! ! |
4903 Color initialize! |
4917 Color initialize! |