[squeak-dev] Starting programming in smalltalk problem to mix two colors

Tom18 geminy95 at hotmail.com
Tue Jun 2 20:50:29 UTC 2009


Hello everybody i am starting programming in smalltalk. I hav already posted
on the forum and I have had some answers to solve a part of my problem but I
still cannot do what I want to do.
Here is what I want to do, I would like to mix two colors that I have
selected in two different HSVA selectors and get the result in a square
morph or something like that but I don't manage to mix the two colors and to
get the result of it into a morph. Does anyone know what to do?
Here is the code (i am using pharo):

exampleColorMixer
	"Open a window with a color mixer."

	|dialog builder|
	builder := ExampleBuilderMorph new.
	dialog := (builder newPluggableDialogWindow: 'Example Color Mixer')
useDefaultOKButton.
	dialog contentMorph: (dialog newRow: {
		dialog newLabelGroup: {
			'Color Selector 1' ->
			((dialog newHSVASelector: Color black
					help: 'This is a hue-saturation-volume-alpha selector')
					minHeight: 100; minWidth: 120).
			'Color Selector 2' ->
			((dialog newHSVASelector: Color green
					help: 'This is a hue-saturation-volume-alpha selector')
					minHeight: 100; minWidth: 120)}.
			dialog newVerticalSeparator.
		dialog newTitle: 'Mixed Color' for:
			((dialog newHSVASelector: Color cyan
					help: 'This is a mixed color from the two other colors.')
					minHeight: 184; minWidth: 184)});
		model: nil.
	builder openModal: dialog 

Thanks for the future responses.
-- 
View this message in context: http://www.nabble.com/Starting-programming-in-smalltalk-problem-to-mix-two-colors-tp23840566p23840566.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.




More information about the Squeak-dev mailing list