Color
Last updated at 7:41 pm UTC on 18 May 2022
Color is a subclass of Object
Color is a surprisingly complex subject; some thoughts and links from a professor that teaches about colour in software .
Some colors are predefined, for example:
Color red
Interesting methods include:
- darker
- dansDarker
- lighter
- and similar methods
The following code produces a list of the predefined colors:
(Color class organization listAtCategoryNamed: 'named colors')
asSortedCollection do:
[ :colorName | Transcript show: '- ', colorName ; cr]
(Squeak 3.3a-4769) (2006)
- 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
In 2010 pantonePurpleU was added to the list.
There are also 'crayons' colors, see class category 'named colors - crayons'.
Transcript clear.
(Color class organization listAtCategoryNamed: 'named colors - crayons')
asSortedCollection do:
[ :colorName | Transcript show: '- ', colorName ; cr]
- aluminum
- aqua
- asparagus
- banana
- blueberry
- bubblegum
- cantaloupe
- carnation
- cayenne
- clover
- eggplant
- fern
- flora
- grape
- honeydew
- ice
- iron
- lavender
- lead
- lemon
- licorice
- lime
- magnesium
- maraschino
- maroon
- mercury
- midnight
- mocha
- moss
- nickel
- ocean
- orchid
- plum
- salmon
- seaFoam
- silver
- sky
- snow
- spindrift
- spring
- steel
- strawberry
- tangerine
- teal
- tin
- tungsten
- turquoise
How to design a color explorer with Morphic
https://codingitwrong.com/2021/04/28/creating-a-smalltalk-app-with-morphic-designer.html
tagBeginner