-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #4: initial cut at bringing over the Text class from GLASS (3.7…
…) ... successful load of GsDevKit_stones-GLASS package
- Loading branch information
1 parent
61d6e04
commit 1280518
Showing
325 changed files
with
2,710 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
RwSimpleProjectLoadComponentV2 { | ||
#name : 'GLASS', | ||
#condition : 'common', | ||
#projectNames : [ ], | ||
#componentNames : [ ], | ||
#packageNames : [ | ||
'GsDevKit_stones-GLASS' | ||
], | ||
#comment : 'GLASS classes needed to support the Text, since Text is (currently) passed back as a result when a remote tODE command is executed ... a feature we want (remote tODE commands)' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I am an abstract collection of elements with a fixed range of integers (from 1 to n>=0) as external keys. |
5 changes: 5 additions & 0 deletions
5
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/class/new.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
instance creation | ||
new | ||
"Answer a new instance of me, with size = 0." | ||
|
||
^self new: 0 |
6 changes: 6 additions & 0 deletions
6
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/class/new.withAll..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
instance creation | ||
new: size withAll: value | ||
"Answer an instance of me, with number of elements equal to size, each | ||
of which refers to the argument, value." | ||
|
||
^(self new: size) atAllPut: value |
14 changes: 14 additions & 0 deletions
14
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/class/newFrom..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
instance creation | ||
newFrom: aCollection | ||
"Answer an instance of me containing the same elements as aCollection." | ||
| newArray | | ||
newArray _ self new: aCollection size. | ||
1 to: aCollection size do: [:i | newArray at: i put: (aCollection at: i)]. | ||
^ newArray | ||
|
||
" Array newFrom: {1. 2. 3} | ||
{1. 2. 3} as: Array | ||
{1. 2. 3} as: ByteArray | ||
{$c. $h. $r} as: String | ||
{$c. $h. $r} as: Text | ||
" |
8 changes: 8 additions & 0 deletions
8
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/class/with..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
instance creation | ||
with: anObject | ||
"Answer a new instance of me, containing only anObject." | ||
|
||
| newCollection | | ||
newCollection _ self new: 1. | ||
newCollection at: 1 put: anObject. | ||
^newCollection |
9 changes: 9 additions & 0 deletions
9
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/class/with.with..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
instance creation | ||
with: firstObject with: secondObject | ||
"Answer a new instance of me, containing firstObject and secondObject." | ||
|
||
| newCollection | | ||
newCollection _ self new: 2. | ||
newCollection at: 1 put: firstObject. | ||
newCollection at: 2 put: secondObject. | ||
^newCollection |
11 changes: 11 additions & 0 deletions
11
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/class/with.with.with..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
instance creation | ||
with: firstObject with: secondObject with: thirdObject | ||
"Answer a new instance of me, containing only the three arguments as | ||
elements." | ||
|
||
| newCollection | | ||
newCollection _ self new: 3. | ||
newCollection at: 1 put: firstObject. | ||
newCollection at: 2 put: secondObject. | ||
newCollection at: 3 put: thirdObject. | ||
^newCollection |
12 changes: 12 additions & 0 deletions
12
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/class/with.with.with.with..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
instance creation | ||
with: firstObject with: secondObject with: thirdObject with: fourthObject | ||
"Answer a new instance of me, containing only the three arguments as | ||
elements." | ||
|
||
| newCollection | | ||
newCollection _ self new: 4. | ||
newCollection at: 1 put: firstObject. | ||
newCollection at: 2 put: secondObject. | ||
newCollection at: 3 put: thirdObject. | ||
newCollection at: 4 put: fourthObject. | ||
^newCollection |
13 changes: 13 additions & 0 deletions
13
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/class/with.with.with.with.with..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
instance creation | ||
with: firstObject with: secondObject with: thirdObject with: fourthObject with: fifthObject | ||
"Answer a new instance of me, containing only the five arguments as | ||
elements." | ||
|
||
| newCollection | | ||
newCollection _ self new: 5. | ||
newCollection at: 1 put: firstObject. | ||
newCollection at: 2 put: secondObject. | ||
newCollection at: 3 put: thirdObject. | ||
newCollection at: 4 put: fourthObject. | ||
newCollection at: 5 put: fifthObject. | ||
^newCollection |
13 changes: 13 additions & 0 deletions
13
...vKit_stones-GLASS.package/ArrayedCollection.class/class/with.with.with.with.with.with..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
instance creation | ||
with: firstObject with: secondObject with: thirdObject with: fourthObject with: fifthObject with: sixthObject | ||
"Answer a new instance of me, containing only the 6 arguments as elements." | ||
|
||
| newCollection | | ||
newCollection _ self new: 6. | ||
newCollection at: 1 put: firstObject. | ||
newCollection at: 2 put: secondObject. | ||
newCollection at: 3 put: thirdObject. | ||
newCollection at: 4 put: fourthObject. | ||
newCollection at: 5 put: fifthObject. | ||
newCollection at: 6 put: sixthObject. | ||
^ newCollection |
5 changes: 5 additions & 0 deletions
5
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/class/withAll..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
instance creation | ||
withAll: aCollection | ||
"Create a new collection containing all the elements from aCollection." | ||
|
||
^ (self new: aCollection size) replaceFrom: 1 to: aCollection size with: aCollection |
3 changes: 3 additions & 0 deletions
3
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/instance/add..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
adding | ||
add: newObject | ||
self shouldNotImplement |
4 changes: 4 additions & 0 deletions
4
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/instance/asSortedArray.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sorting | ||
asSortedArray | ||
self isSorted ifTrue: [^ self asArray]. | ||
^ super asSortedArray |
3 changes: 3 additions & 0 deletions
3
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/instance/byteSize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
objects from disk | ||
byteSize | ||
^self basicSize * self bytesPerBasicElement |
7 changes: 7 additions & 0 deletions
7
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/instance/bytesPerBasicElement.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
objects from disk | ||
bytesPerBasicElement | ||
"Answer the number of bytes that each of my basic elements requires. | ||
In other words: | ||
self basicSize * self bytesPerBasicElement | ||
should equal the space required on disk by my variable sized representation." | ||
^self class isBytes ifTrue: [ 1 ] ifFalse: [ 4 ] |
3 changes: 3 additions & 0 deletions
3
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/instance/bytesPerElement.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
objects from disk | ||
bytesPerElement | ||
^self class isBytes ifTrue: [ 1 ] ifFalse: [ 4 ]. |
4 changes: 4 additions & 0 deletions
4
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/instance/defaultElement.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
private | ||
defaultElement | ||
|
||
^nil |
14 changes: 14 additions & 0 deletions
14
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/instance/isSorted.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
sorting | ||
isSorted | ||
"Return true if the receiver is sorted by the given criterion. | ||
Optimization for isSortedBy: [:a :b | a <= b]." | ||
|
||
| lastElm elm | | ||
self isEmpty ifTrue: [^ true]. | ||
lastElm _ self first. | ||
2 to: self size do: | ||
[:index | | ||
elm _ self at: index. | ||
lastElm <= elm ifFalse: [^ false]. | ||
lastElm _ elm]. | ||
^ true |
13 changes: 13 additions & 0 deletions
13
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/instance/isSortedBy..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
sorting | ||
isSortedBy: aBlock | ||
"Return true if the receiver is sorted by the given criterion." | ||
|
||
| lastElm elm | | ||
self isEmpty ifTrue: [^ true]. | ||
lastElm _ self first. | ||
2 to: self size do: | ||
[:index | | ||
elm _ self at: index. | ||
(aBlock value: lastElm value: elm) ifFalse: [^ false]. | ||
lastElm _ elm]. | ||
^ true |
19 changes: 19 additions & 0 deletions
19
...sDevKit_stones-GLASS.package/ArrayedCollection.class/instance/storeElementsFrom.to.on..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
private | ||
storeElementsFrom: firstIndex to: lastIndex on: aStream | ||
|
||
| noneYet defaultElement arrayElement | | ||
noneYet _ true. | ||
defaultElement _ self defaultElement. | ||
firstIndex to: lastIndex do: | ||
[:index | | ||
arrayElement _ self at: index. | ||
arrayElement = defaultElement | ||
ifFalse: | ||
[noneYet | ||
ifTrue: [noneYet _ false] | ||
ifFalse: [aStream nextPut: $;]. | ||
aStream nextPutAll: ' at: '. | ||
aStream store: index. | ||
aStream nextPutAll: ' put: '. | ||
aStream store: arrayElement]]. | ||
^noneYet |
11 changes: 11 additions & 0 deletions
11
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/instance/storeOn..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
printing | ||
storeOn: aStream | ||
|
||
aStream nextPutAll: '(('. | ||
aStream nextPutAll: self class name. | ||
aStream nextPutAll: ' new: '. | ||
aStream store: self size. | ||
aStream nextPut: $). | ||
(self storeElementsFrom: 1 to: self size on: aStream) | ||
ifFalse: [aStream nextPutAll: '; yourself']. | ||
aStream nextPut: $) |
23 changes: 23 additions & 0 deletions
23
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"class" : { | ||
"new" : "", | ||
"new:withAll:" : "", | ||
"newFrom:" : "", | ||
"with:" : "", | ||
"with:with:" : "", | ||
"with:with:with:" : "", | ||
"with:with:with:with:" : "", | ||
"with:with:with:with:with:" : "", | ||
"with:with:with:with:with:with:" : "sw 10/24/1998 22:22", | ||
"withAll:" : "sma 5/12/2000 17:37" }, | ||
"instance" : { | ||
"add:" : "sma 5/12/2000 14:09", | ||
"asSortedArray" : "sma 5/12/2000 18:18", | ||
"byteSize" : "nk 3/17/2004 15:22", | ||
"bytesPerBasicElement" : "nk 3/17/2004 16:28", | ||
"bytesPerElement" : "nk 3/17/2004 18:51", | ||
"defaultElement" : "", | ||
"isSorted" : "sma 6/1/2000 11:57", | ||
"isSortedBy:" : "sma 6/1/2000 11:58", | ||
"storeElementsFrom:to:on:" : "", | ||
"storeOn:" : "" } } |
14 changes: 14 additions & 0 deletions
14
src/GsDevKit_stones-GLASS.package/ArrayedCollection.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "GsDevKit_stones-GLASS", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "<historical>", | ||
"instvars" : [ | ||
], | ||
"name" : "ArrayedCollection", | ||
"pools" : [ | ||
], | ||
"super" : "SequenceableCollection", | ||
"type" : "normal" } |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
named colors | ||
black | ||
^Black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
named colors | ||
blue | ||
^Blue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
named colors | ||
brown | ||
^Brown |
26 changes: 26 additions & 0 deletions
26
src/GsDevKit_stones-GLASS.package/Color.class/class/colorFrom..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
instance creation | ||
colorFrom: parm | ||
"Return an instantiated color from parm. If parm is already a color, return it, else return the result of my performing it if it's a symbol or, if it is a list, it can either be an array of three numbers, which will be interpreted as RGB values, or a list of symbols, the first of which is sent to me and then the others of which are in turn sent to the prior result, thus allowing entries of the form #(blue darker). Else just return the thing" | ||
|
||
| aColor firstParm | | ||
(parm isKindOf: Color) ifTrue: [^ parm]. | ||
(parm isSymbol) ifTrue: [^ self perform: parm]. | ||
(parm isString) ifTrue: [^ self fromString: parm]. | ||
((parm isKindOf: SequenceableCollection) and: [parm size > 0]) | ||
ifTrue: | ||
[firstParm := parm first. | ||
(firstParm isKindOf: Number) ifTrue: | ||
[^ self fromRgbTriplet: parm]. | ||
aColor := self colorFrom: firstParm. | ||
parm doWithIndex: | ||
[:sym :ind | ind > 1 ifTrue: | ||
[aColor := aColor perform: sym]]. | ||
^ aColor]. | ||
^ parm | ||
|
||
" | ||
Color colorFrom: #(blue darker) | ||
Color colorFrom: Color blue darker | ||
Color colorFrom: #blue | ||
Color colorFrom: #(0.0 0.0 1.0) | ||
" |
48 changes: 48 additions & 0 deletions
48
src/GsDevKit_stones-GLASS.package/Color.class/class/colorFromPixelValue.depth..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
instance creation | ||
colorFromPixelValue: p depth: d | ||
"Convert a pixel value for the given display depth into a color." | ||
"Details: For depths of 8 or less, the pixel value is simply looked up in a table. For greater depths, the color components are extracted and converted into a color." | ||
|
||
| r g b alpha | | ||
d = 8 ifTrue: [^ IndexedColors at: (p bitAnd: 16rFF) + 1]. | ||
d = 4 ifTrue: [^ IndexedColors at: (p bitAnd: 16r0F) + 1]. | ||
d = 2 ifTrue: [^ IndexedColors at: (p bitAnd: 16r03) + 1]. | ||
d = 1 ifTrue: [^ IndexedColors at: (p bitAnd: 16r01) + 1]. | ||
|
||
(d = 16) | (d = 15) ifTrue: [ | ||
"five bits per component" | ||
r _ (p bitShift: -10) bitAnd: 16r1F. | ||
g _ (p bitShift: -5) bitAnd: 16r1F. | ||
b _ p bitAnd: 16r1F. | ||
(r = 0 and: [g = 0]) ifTrue: [ | ||
b = 0 ifTrue: [^Color transparent]. | ||
b = 1 ifTrue: [^Color black]]. | ||
^ Color r: r g: g b: b range: 31]. | ||
|
||
d = 32 ifTrue: [ | ||
"eight bits per component; 8 bits of alpha" | ||
r _ (p bitShift: -16) bitAnd: 16rFF. | ||
g _ (p bitShift: -8) bitAnd: 16rFF. | ||
b _ p bitAnd: 16rFF. | ||
alpha _ p bitShift: -24. | ||
alpha = 0 ifTrue: [^Color transparent]. | ||
(r = 0 and: [g = 0 and: [b = 0]]) ifTrue: [^Color transparent]. | ||
alpha < 255 | ||
ifTrue: [^ (Color r: r g: g b: b range: 255) alpha: (alpha asFloat / 255.0)] | ||
ifFalse: [^ (Color r: r g: g b: b range: 255)]]. | ||
|
||
d = 12 ifTrue: [ | ||
"four bits per component" | ||
r _ (p bitShift: -8) bitAnd: 16rF. | ||
g _ (p bitShift: -4) bitAnd: 16rF. | ||
b _ p bitAnd: 16rF. | ||
^ Color r: r g: g b: b range: 15]. | ||
|
||
d = 9 ifTrue: [ | ||
"three bits per component" | ||
r _ (p bitShift: -6) bitAnd: 16r7. | ||
g _ (p bitShift: -3) bitAnd: 16r7. | ||
b _ p bitAnd: 16r7. | ||
^ Color r: r g: g b: b range: 7]. | ||
|
||
self error: 'unknown pixel depth: ', d printString |
5 changes: 5 additions & 0 deletions
5
src/GsDevKit_stones-GLASS.package/Color.class/class/colorNames.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
other | ||
colorNames | ||
"Return a collection of color names." | ||
|
||
^ ColorNames |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
named colors | ||
cyan | ||
^Cyan |
3 changes: 3 additions & 0 deletions
3
src/GsDevKit_stones-GLASS.package/Color.class/class/darkGray.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
named colors | ||
darkGray | ||
^DarkGray |
Oops, something went wrong.