Color.st
changeset 2945 937fdf02965d
parent 2943 6b4dca5fbee2
child 2948 86566f076d30
equal deleted inserted replaced
2944:c1d0599fc178 2945:937fdf02965d
  3369     ^ self darkened
  3369     ^ self darkened
  3370 ! !
  3370 ! !
  3371 
  3371 
  3372 !Color methodsFor:'Compatibility - Squeak'!
  3372 !Color methodsFor:'Compatibility - Squeak'!
  3373 
  3373 
       
  3374 bitPatternForDepth: depth
       
  3375     "Return a Bitmap, possibly containing a stipple pattern, 
       
  3376      that best represents this color at the given depth. 
       
  3377      BitBlt calls this method to convert colors into Bitmaps. 
       
  3378      The resulting Bitmap may be multiple words to represent a stipple 
       
  3379      pattern of several lines.  "
       
  3380 
       
  3381     "See also:      
       
  3382         pixelValueAtDepth:      -- value for single pixel
       
  3383         pixelWordAtDepth:       -- a 32-bit word filled with the pixel value"
       
  3384     "Details: The pattern for the most recently requested depth is cached."
       
  3385 
       
  3386 ^ self.
       
  3387 "/    depth == cachedDepth ifTrue: [^ cachedBitPattern].
       
  3388 "/    cachedDepth _ depth.
       
  3389 "/
       
  3390 "/    depth > 2 ifTrue: [^ cachedBitPattern _ Bitmap with: (self pixelWordForDepth: depth)].
       
  3391 "/    depth = 1 ifTrue: [^ cachedBitPattern _ self halfTonePattern1].
       
  3392 "/    depth = 2 ifTrue: [^ cachedBitPattern _ self halfTonePattern2].
       
  3393 
       
  3394 !
       
  3395 
  3374 darker
  3396 darker
  3375     "return a new color, which is slightly darker than the receiver.
  3397     "return a new color, which is slightly darker than the receiver.
  3376      Almost the same as darkened for Squeak compatibility."
  3398      Almost the same as darkened for Squeak compatibility."
  3377 
  3399 
  3378     ^ self mixed:0.8333 with:Black
  3400     ^ self mixed:0.8333 with:Black
  3652 
  3674 
  3653     ^ 100 - self green
  3675     ^ 100 - self green
  3654 
  3676 
  3655     "Modified: 11.6.1996 / 17:20:07 / cg"
  3677     "Modified: 11.6.1996 / 17:20:07 / cg"
  3656     "Created: 11.6.1996 / 18:30:11 / cg"
  3678     "Created: 11.6.1996 / 18:30:11 / cg"
       
  3679 !
       
  3680 
       
  3681 privateAlpha
       
  3682     "return the internal alpha value (0..255),
       
  3683      where 0 is completely transparent and 255 is completely opaque"
       
  3684 
       
  3685     ^ 255 
       
  3686 
  3657 !
  3687 !
  3658 
  3688 
  3659 red
  3689 red
  3660     "return the red component in percent [0..100]"
  3690     "return the red component in percent [0..100]"
  3661 
  3691 
  4803 
  4833 
  4804     ^ false
  4834     ^ false
  4805 
  4835 
  4806 !
  4836 !
  4807 
  4837 
       
  4838 isTranslucentColor
       
  4839     "return true, if I represent a translucent color, but not transparent"
       
  4840 
       
  4841     ^ false
       
  4842 
       
  4843 !
       
  4844 
  4808 isTransparent
  4845 isTransparent
  4809     "return true, if I represent a completely transparent color"
  4846     "return true, if I represent a completely transparent color"
  4810 
  4847 
  4811     ^ false
  4848     ^ false
  4812 
  4849 
  4859 ! !
  4896 ! !
  4860 
  4897 
  4861 !Color class methodsFor:'documentation'!
  4898 !Color class methodsFor:'documentation'!
  4862 
  4899 
  4863 version
  4900 version
  4864     ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.138 1999-10-06 16:25:38 cg Exp $'
  4901     ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.139 1999-10-06 22:26:32 cg Exp $'
  4865 ! !
  4902 ! !
  4866 Color initialize!
  4903 Color initialize!