-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MDLColor>>allTints and Color>>#asRGBA.
Close: #2
- Loading branch information
Showing
11 changed files
with
85 additions
and
39 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"noMethodMetaData" : true, | ||
"separateMethodMetaAndSource" : false, | ||
"useCypressPropertiesFile" : true } | ||
"noMethodMetaData" : true, | ||
"useCypressPropertiesFile" : true | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Material-Design-Colors.package/Color.extension/instance/asRGBA.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,18 @@ | ||
*Material-Design-Colors | ||
asRGBA | ||
^ String | ||
streamContents: [ :s | | ||
| alph | | ||
alph := self alpha asString. | ||
(alph endsWith: '.0') | ||
ifTrue: [ alph := alph allButLast: 2 ]. | ||
s | ||
nextPutAll: 'rgba('; | ||
<< (self red * 255) ceiling; | ||
nextPut: $,; | ||
<< (self green * 255) ceiling; | ||
nextPut: $,; | ||
<< (self blue * 255) ceiling; | ||
nextPut: $,; | ||
<< alph; | ||
nextPut: $) ] |
3 changes: 3 additions & 0 deletions
3
src/Material-Design-Colors.package/Color.extension/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,3 @@ | ||
{ | ||
"name" : "Color" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/Material-Design-Colors.package/MDLColor.class/class/allTints.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 @@ | ||
accessing | ||
allTints | ||
^ self allDefaultsColors collect: #tint |
19 changes: 10 additions & 9 deletions
19
src/Material-Design-Colors.package/MDLColor.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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
{ | ||
"commentStamp" : "<historical>", | ||
"super" : "Color", | ||
"category" : "Material-Design-Colors", | ||
"classinstvars" : [ | ||
"colors" ], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "<historical>", | ||
"colors" | ||
], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ | ||
"tint", | ||
"code" ], | ||
"code" | ||
], | ||
"name" : "MDLColor", | ||
"pools" : [ | ||
], | ||
"super" : "Color", | ||
"type" : "normal" } | ||
"type" : "normal" | ||
} |
19 changes: 8 additions & 11 deletions
19
src/Material-Design-Colors.package/ManifestMaterialDesignColors.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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
{ | ||
"category" : "Material-Design-Colors", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "<historical>", | ||
"instvars" : [ | ||
], | ||
"name" : "ManifestMaterialDesignColors", | ||
"pools" : [ | ||
], | ||
"super" : "PackageManifest", | ||
"type" : "normal" } | ||
"category" : "Material-Design-Colors", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ ], | ||
"name" : "ManifestMaterialDesignColors", | ||
"type" : "normal" | ||
} |
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
{ | ||
} | ||
{ } |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"noMethodMetaData" : true, | ||
"separateMethodMetaAndSource" : false, | ||
"useCypressPropertiesFile" : true } | ||
"noMethodMetaData" : true, | ||
"useCypressPropertiesFile" : true | ||
} |
27 changes: 27 additions & 0 deletions
27
src/Material-Design-Tests-Colors.package/MDLColorTests.class/instance/testAsRGBA.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,27 @@ | ||
tests | ||
testAsRGBA | ||
"The values were found on Material Design standard." | ||
|
||
| rgbaMap | | ||
rgbaMap := Dictionary new | ||
at: #red put: 'rgba(244,67,54,1)'; | ||
at: #pink put: 'rgba(233,30,99,1)'; | ||
at: #purple put: 'rgba(156,39,176,1)'; | ||
at: #deep_purple put: 'rgba(103,58,183,1)'; | ||
at: #indigo put: 'rgba(63,81,181,1)'; | ||
at: #blue put: 'rgba(33,150,243,1)'; | ||
at: #light_blue put: 'rgba(3,169,244,1)'; | ||
at: #cyan put: 'rgba(0,188,212,1)'; | ||
at: #teal put: 'rgba(0,150,136,1)'; | ||
at: #green put: 'rgba(76,175,80,1)'; | ||
at: #light_green put: 'rgba(139,195,74,1)'; | ||
at: #lime put: 'rgba(205,220,57,1)'; | ||
at: #yellow put: 'rgba(255,235,59,1)'; | ||
at: #amber put: 'rgba(255,193,7,1)'; | ||
at: #orange put: 'rgba(255,152,0,1)'; | ||
at: #deep_orange put: 'rgba(255,87,34,1)'; | ||
at: #brown put: 'rgba(121,85,72,1)'; | ||
at: #grey put: 'rgba(158,158,158,1)'; | ||
at: #blue_grey put: 'rgba(96,125,139,1)'; | ||
yourself. | ||
rgbaMap keysAndValuesDo: [ :tint :rgba | self assert: (MDLColor tint: tint) asRGBA equals: rgba ] |
19 changes: 8 additions & 11 deletions
19
src/Material-Design-Tests-Colors.package/MDLColorTests.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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
{ | ||
"category" : "Material-Design-Tests-Colors", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "MDLColorTests", | ||
"pools" : [ | ||
], | ||
"super" : "TestCase", | ||
"type" : "normal" } | ||
"category" : "Material-Design-Tests-Colors", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ ], | ||
"name" : "MDLColorTests", | ||
"type" : "normal" | ||
} |
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
{ | ||
} | ||
{ } |