'From etoys3.0 of 24 February 2008 [latest update: #2081] on 15 September 2008 at 11:06:51 am'! "Change Set: cleanupDWH Date: 15 September 2008 Author: Yoshiki Ohshima This changeset removes the many newer named colors, and remove the copy class feature from Browser. The comment fix for Integer>>tinyBenchmarks and >> are reverted to previous version with inprecise ones."! Object subclass: #Color instanceVariableNames: 'rgb cachedDepth cachedBitPattern ' classVariableNames: 'Black Blue BlueShift Brown CachedColormaps ColorChart ColorNames ComponentMask ComponentMax Cyan DarkGray Gray GrayToIndexMap Green GreenShift HalfComponentMask HighLightBitmaps IndexedColors LightBlue LightBrown LightCyan LightGray LightGreen LightMagenta LightOrange LightRed LightYellow Magenta MaskingMap Orange PaleBlue PaleBuff PaleGreen PaleMagenta PaleOrange PalePeach PaleRed PaleTan PaleYellow PureBlue PureCyan PureGreen PureMagenta PureRed PureYellow RandomStream Red RedShift TranslucentPatterns Transparent VeryDarkGray VeryLightGray VeryPaleRed VeryVeryDarkGray VeryVeryLightGray White Yellow ' poolDictionaries: '' category: 'Graphics-Primitives'! !Browser methodsFor: 'class functions' stamp: 'yo 8/28/2008 01:12'! classListMenu: aMenu shifted: shifted "Set up the menu to apply to the receiver's class list, honoring the #shifted boolean" shifted ifTrue: [^ self shiftedClassListMenu: aMenu]. aMenu addList: #( - ('browse full (b)' browseMethodFull) ('browse hierarchy (h)' spawnHierarchy) ('browse protocol (p)' browseFullProtocol) - ('printOut' printOutClass) ('fileOut' fileOutClass) - ('show hierarchy' hierarchy) ('show definition' editClass) ('show comment' editComment) - ('inst var refs...' browseInstVarRefs) ('inst var defs...' browseInstVarDefs) - ('class var refs...' browseClassVarRefs) ('class vars' browseClassVariables) ('class refs (N)' browseClassRefs) - ('rename class ...' renameClass) ('remove class (x)' removeClass) - ('find method...' findMethod) ('find method wildcard...' findMethodWithWildcard) - ('more...' offerShiftedClassListMenu)). ^ aMenu! ! !Color class methodsFor: 'class initialization' stamp: 'di 1/6/1999 17:44'! initializeNames "Name some colors." "Color initializeNames" ColorNames _ OrderedCollection new. self named: #black put: (Color r: 0 g: 0 b: 0). self named: #veryVeryDarkGray put: (Color r: 0.125 g: 0.125 b: 0.125). self named: #veryDarkGray put: (Color r: 0.25 g: 0.25 b: 0.25). self named: #darkGray put: (Color r: 0.375 g: 0.375 b: 0.375). self named: #gray put: (Color r: 0.5 g: 0.5 b: 0.5). self named: #lightGray put: (Color r: 0.625 g: 0.625 b: 0.625). self named: #veryLightGray put: (Color r: 0.75 g: 0.75 b: 0.75). self named: #veryVeryLightGray put: (Color r: 0.875 g: 0.875 b: 0.875). self named: #white put: (Color r: 1.0 g: 1.0 b: 1.0). self named: #red put: (Color r: 1.0 g: 0 b: 0). self named: #yellow put: (Color r: 1.0 g: 1.0 b: 0). self named: #green put: (Color r: 0 g: 1.0 b: 0). self named: #cyan put: (Color r: 0 g: 1.0 b: 1.0). self named: #blue put: (Color r: 0 g: 0 b: 1.0). self named: #magenta put: (Color r: 1.0 g: 0 b: 1.0). self named: #brown put: (Color r: 0.6 g: 0.2 b: 0). self named: #orange put: (Color r: 1.0 g: 0.6 b: 0). self named: #lightRed put: (Color r: 1.0 g: 0.8 b: 0.8). self named: #lightYellow put: (Color r: 1.0 g: 1.0 b: 0.8). self named: #lightGreen put: (Color r: 0.8 g: 1.0 b: 0.6). self named: #lightCyan put: (Color r: 0.4 g: 1.0 b: 1.0). self named: #lightBlue put: (Color r: 0.8 g: 1.0 b: 1.0). self named: #lightMagenta put: (Color r: 1.0 g: 0.8 b: 1.0). self named: #lightBrown put: (Color r: 1.0 g: 0.6 b: 0.2). self named: #lightOrange put: (Color r: 1.0 g: 0.8 b: 0.4). self named: #transparent put: (TranslucentColor new alpha: 0.0). ! ! !Color class methodsFor: 'named colors' stamp: 'yo 8/28/2008 01:06'! paleBlue ^(Color r: 0.87 g: 0.976 b: 0.995) ! ! !Color class methodsFor: 'named colors' stamp: 'yo 8/28/2008 01:07'! paleBuff ^(Color r: 0.995 g: 0.979 b: 0.921)! ! !Color class methodsFor: 'named colors' stamp: 'yo 8/28/2008 01:06'! paleGreen ^(Color r: 0.874 g: 1.0 b: 0.835)! ! !Color class methodsFor: 'named colors' stamp: 'yo 8/28/2008 01:05'! paleMagenta ^(Color r: 1.0 g: 0.901 b: 1.0)! ! !Color class methodsFor: 'named colors' stamp: 'yo 8/28/2008 01:03'! paleOrange ^ (Color r: 0.991 g: 0.929 b: 0.843) ! ! !Color class methodsFor: 'named colors' stamp: 'yo 8/28/2008 01:03'! palePeach ^(Color r: 1.0 g: 0.929 b: 0.835)! ! !Color class methodsFor: 'named colors' stamp: 'yo 8/28/2008 01:07'! paleRed ^(Color r: 1.0 g: 0.901 b: 0.901)! ! !Color class methodsFor: 'named colors' stamp: 'yo 8/28/2008 01:02'! paleTan ^(Color r: 0.921 g: 0.878 b: 0.78) ! ! !Color class methodsFor: 'named colors' stamp: 'yo 8/28/2008 01:05'! paleYellow ^(Color r: 1.0 g: 1.0 b: 0.85)! ! !Color class methodsFor: 'named colors'! red ^Red! ! !Color class methodsFor: 'named colors' stamp: 'yo 8/28/2008 01:06'! veryPaleRed ^(Color r: 1.0 g: 0.948 b: 0.948)! ! !Color class methodsFor: 'named colors'! veryVeryDarkGray ^VeryVeryDarkGray! ! !Integer methodsFor: 'nil' stamp: 'ar 9/10/1999 16:11'! tinyBenchmarks "Report the results of running the two tiny Squeak benchmarks. ar 9/10/1999: Adjusted to run at least 1 sec to get more stable results" "0 tinyBenchmarks" "On a 292 MHz G3 Mac: 22727272 bytecodes/sec; 984169 sends/sec" "On a 400 MHz PII/Win98: 18028169 bytecodes/sec; 1081272 sends/sec" | t1 t2 r n1 n2 | n1 _ 1. [t1 _ Time millisecondsToRun: [n1 benchmark]. t1 < 1000] whileTrue:[n1 _ n1 * 2]. "Note: #benchmark's runtime is about O(n)" n2 _ 28. [t2 _ Time millisecondsToRun: [r _ n2 benchFib]. t2 < 1000] whileTrue:[n2 _ n2 + 1]. "Note: #benchFib's runtime is about O(n^2)." ^ ((n1 * 500000 * 1000) // t1) printString, ' bytecodes/sec; ', ((r * 1000) // t2) printString, ' sends/sec'! ! !Integer methodsFor: 'nil'! >> shiftAmount "left shift" shiftAmount < 0 ifTrue: [self error: 'negative arg']. ^ self bitShift: 0 - shiftAmount! ! !Color class reorganize! ('instance creation' colorFromPixelValue:depth: colorFrom: fromArray: fromRgbTriplet: fromString: gray: h:s:v: h:s:v:alpha: new random r:g:b: r:g:b:alpha: r:g:b:range: saturatedRandom) ('class initialization' initialize initializeGrayToIndexMap initializeHighLights initializeIndexedColors initializeNames initializeTranslucentPatterns named:put:) ('examples' colorRampForDepth:extent: hotColdShades: showColorCube showColors: showHSVPalettes showHuesInteractively wheel: wheel:saturation:brightness:) ('named colors' black blue brown cyan darkGray gray green lightBlue lightBrown lightCyan lightGray lightGreen lightMagenta lightOrange lightRed lightYellow magenta orange paleBlue paleBuff paleGreen paleMagenta paleOrange palePeach paleRed paleTan paleYellow red tan transparent veryDarkGray veryLightGray veryPaleRed veryVeryDarkGray veryVeryLightGray white yellow) ('colormaps' cachedColormapFrom:to: colorMapIfNeededFrom:to: computeColormapFrom:to: computeRGBColormapFor:bitsPerColor:) ('other' colorNames indexedColors maskingMap: pixelScreenForDepth: quickHighLight: shutDown translucentMaskFor:depth:) ('color from user' colorPaletteCaptionHeight colorPaletteForDepth:extent: colorPaletteGrayWidth colorTest:extent:colorMapper: fromUser noColorCaption oldColorPaletteForDepth:extent:) ('*Tweak-Kedama' isPrototypeTurtlePlayer) ('*siss-instance creation' sissCreateInstanceFromSexp:idref:from:to:) ! Object subclass: #Color instanceVariableNames: 'rgb cachedDepth cachedBitPattern' classVariableNames: 'Black Blue BlueShift Brown CachedColormaps ColorChart ColorNames ComponentMask ComponentMax Cyan DarkGray Gray GrayToIndexMap Green GreenShift HalfComponentMask HighLightBitmaps IndexedColors LightBlue LightBrown LightCyan LightGray LightGreen LightMagenta LightOrange LightRed LightYellow Magenta MaskingMap Orange PureBlue PureCyan PureGreen PureMagenta PureRed PureYellow RandomStream Red RedShift TranslucentPatterns Transparent VeryDarkGray VeryLightGray VeryVeryDarkGray VeryVeryLightGray White Yellow' poolDictionaries: '' category: 'Graphics-Primitives'! Browser removeSelector: #copyClass! "Postscript: " Browser removeSelector: #copyClass. !