Skip to content

Commit

Permalink
add a couple of inspector extensions for colors
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanlm committed Sep 23, 2021
1 parent 53f0f8b commit dc849e8
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/NewTools-Inspector-Extensions/Color.extension.st
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
]

0 comments on commit dc849e8

Please sign in to comment.