Color.st
changeset 601 2c4c1e797909
parent 595 bd1adadd24d9
child 611 e0442439a3c6
equal deleted inserted replaced
600:b10cd484ea92 601:2c4c1e797909
    60     To do so, add a statement like: 'Color getColors5x5x5' to the startup.rc file.
    60     To do so, add a statement like: 'Color getColors5x5x5' to the startup.rc file.
    61     (beside 5x5x5, there are various other size combinations available).
    61     (beside 5x5x5, there are various other size combinations available).
    62     However, doing so may make things worse when displaying bitmap images, since this
    62     However, doing so may make things worse when displaying bitmap images, since this
    63     preallocated table may steal colors from the image ...
    63     preallocated table may steal colors from the image ...
    64 
    64 
    65     Instance variables:
    65     [Instance variables:]
    66 
    66 
    67       redVal          <Number>        the red component (0..100)
    67       redVal          <Number>        the red component (0..100)
    68       greenVal        <Number>        the green component (0..100)
    68       greenVal        <Number>        the green component (0..100)
    69       blueVal         <Number>        the blue component (0..100)
    69       blueVal         <Number>        the blue component (0..100)
    70       device          <Device>        the device I am on, or nil
    70       device          <Device>        the device I am on, or nil
    71       colorId         <Object>        some device dependent identifier (or nil if dithered)
    71       colorId         <Object>        some device dependent identifier (or nil if dithered)
    72       ditherForm      <Form>          the Form to dither this color (if non-nil)
    72       ditherForm      <Form>          the Form to dither this color (if non-nil)
    73       writable        <Boolean>       true if this is for a writable color cell
    73       writable        <Boolean>       true if this is for a writable color cell
    74 
    74 
    75     Class variables:
    75     [Class variables:]
    76 
    76 
    77       Lobby           <Registry>      all colors in use - keeps track of already allocated
    77       Lobby           <Registry>      all colors in use - keeps track of already allocated
    78 				      colors for reuse and finalization.
    78                                       colors for reuse and finalization.
    79       Cells           <Registry>      keeps track of allocated writable color cells
    79       Cells           <Registry>      keeps track of allocated writable color cells
    80 
    80 
    81       FixColors       <Array>         preallocated colors for dithering on Display
    81       FixColors       <Array>         preallocated colors for dithering on Display
    82       NumRedFix       <Integer>       number of distinct red values in FixColors
    82       NumRedFix       <Integer>       number of distinct red values in FixColors
    83       NumGreenFix     <Integer>       number of distinct green values in FixColors
    83       NumGreenFix     <Integer>       number of distinct green values in FixColors
    96       Red             <Color>         red, needed for dithering
    96       Red             <Color>         red, needed for dithering
    97       Green           <Color>         green, for dithering
    97       Green           <Color>         green, for dithering
    98       Blue            <Color>         blue, for dithering
    98       Blue            <Color>         blue, for dithering
    99 
    99 
   100       DitherColors    <Collection>    some preallocated colors for dithering
   100       DitherColors    <Collection>    some preallocated colors for dithering
   101 				      (kept, so they are available when needed)
   101                                       (kept, so they are available when needed)
   102 
   102 
   103       RetryAllocation <Boolean>       this flag controls how a request for a
   103       RetryAllocation <Boolean>       this flag controls how a request for a
   104 				      color should be handled which failed previously.
   104                                       color should be handled which failed previously.
   105 				      I.e. a color is asked for, which was dithered
   105                                       I.e. a color is asked for, which was dithered
   106 				      the last time. Since it could happen, that in
   106                                       the last time. Since it could happen, that in
   107 				      the meantime more colors became free, the request
   107                                       the meantime more colors became free, the request
   108 				      might succeed this time - however, your screen may
   108                                       might succeed this time - however, your screen may
   109 				      look a bit funny, due to having both dithered and
   109                                       look a bit funny, due to having both dithered and
   110 				      undithered versions around.
   110                                       undithered versions around.
   111 				      The default is true, which means: do retry
   111                                       The default is true, which means: do retry
   112 
   112 
   113     compatibility issues:
   113     compatibility issues:
   114 
   114 
   115 	ST-80 seems to represent colors internally with scaled smallInteger
   115         ST-80 seems to represent colors internally with scaled smallInteger
   116 	components (this can be guessed from uses of
   116         components (this can be guessed from uses of
   117 	scaledRed:scaledGreen:scaledBlue:). The main instance creation method is
   117         scaledRed:scaledGreen:scaledBlue:). The main instance creation method is
   118 	via 'ColorValue red:green:blue:', passing components in 0..1.
   118         via 'ColorValue red:green:blue:', passing components in 0..1.
   119 	In ST/X, component are internally represented as percent.
   119         In ST/X, component are internally represented as percent.
   120 	For more compatibility (when subclassing color), these internals may
   120         For more compatibility (when subclassing color), these internals may
   121 	change in the near future. For migration, a compatibility subclass
   121         change in the near future. For migration, a compatibility subclass
   122 	called ColorValue is provided. 
   122         called ColorValue is provided. 
   123 	After the change, Color will be renamed to ColorValue and Color
   123         After the change, Color will be renamed to ColorValue and Color
   124 	be made a subclass of ColorValue (offering the 0..100 interface for
   124         be made a subclass of ColorValue (offering the 0..100 interface for
   125 	backward compatibility).
   125         backward compatibility).
       
   126 
       
   127     [see also:]
       
   128         DeviceWorkstation 
       
   129         GraphicsContext DeviceDrawable Form Image Colormap
       
   130         Font Cursor
   126 "
   131 "
   127 ! !
   132 ! !
   128 
   133 
   129 !Color class methodsFor:'initialization'!
   134 !Color class methodsFor:'initialization'!
   130 
   135 
  2724 ! !
  2729 ! !
  2725 
  2730 
  2726 !Color class methodsFor:'documentation'!
  2731 !Color class methodsFor:'documentation'!
  2727 
  2732 
  2728 version
  2733 version
  2729     ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.39 1996-04-23 11:40:48 cg Exp $'
  2734     ^ '$Header: /cvs/stx/stx/libview/Color.st,v 1.40 1996-04-23 20:12:21 cg Exp $'
  2730 ! !
  2735 ! !
  2731 Color initialize!
  2736 Color initialize!