-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a couple of inspector extensions for colors
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 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,26 @@ | ||
Extension { #name : #Color } | ||
|
||
{ #category : #'*NewTools-Inspector-Extensions' } | ||
Color >> inspectionColor [ | ||
<inspectorPresentationOrder: 10 title: 'Color'> | ||
|
||
^ SpImagePresenter new | ||
image: (Morph new | ||
color: self; | ||
asFormOfSize: 50@50); | ||
yourself | ||
] | ||
|
||
{ #category : #'*NewTools-Inspector-Extensions' } | ||
Color class >> inspectionColors [ | ||
<inspectorPresentationOrder: 10 title: 'Registered'> | ||
|
||
^ SpListPresenter new | ||
items: ColorRegistry associations; | ||
display: [ :each | each key ]; | ||
displayIcon: [ :each | | ||
Morph new | ||
color: each value; | ||
asFormOfSize: 20@20 ]; | ||
yourself | ||
] |