This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-03-02 18:51:58

Mokat
Scratcher
Registered: 2011-12-08
Posts: 1000+

Color Picker-Help mee!

I Am Making A Paint Game. I Took A Screenshot Of The Scratch Paint Editor Color Picker, Which I Am Using As The Color Picker In The Paint Game. Can Someone Please Help Me To Script The Paintbrush So That It Makes The Pen Color The Color Selected On The Color Picker?


http://www.eggcave.com/egg/977371.pnghttp://www.eggcave.com/egg/977376.pnghttp://www.eggcave.com/egg/1005291.pnghttp://www.eggcave.com/egg/996745.png

Offline

 

#2 2012-03-02 19:04:06

videogame9
Scratcher
Registered: 2008-05-12
Posts: 1000+

Re: Color Picker-Help mee!

There Is Not A Special Secret English Rule That Does Not Count Something As A Word Unless You Capitalize The First Letter. Stop Following Said Rule.


http://img641.imageshack.us/img641/4118/newvg9logo.png
QUOTE OF THE RIGHT NOW: why are we arguing about dead babies? -videogame9

Offline

 

#3 2012-03-02 19:24:04

ProgramCAT
Scratcher
Registered: 2011-12-13
Posts: 500+

Re: Color Picker-Help mee!

Here's a useful script from this thread...

HD123 wrote:

Here is a simple script to make an all-color color picker.

set [left_edge_x v] to [-240]
set [height v] to [150]
set [width v] to [150]
repeat (height)
pen down
repeat (width)
change x by [1]
change pen color by ([200]/(width))
end
pen up
set x to (left_edge_x)
change y by [-1]
change pen shade by ([100]/(height))
end
Change the width variable to change width, height variable to change height.  Put in the x coordinate you want for the left edge of your color picker in the left_edge_x variable.  Put this entire script in a 1px black dot.  After the script, you should probably add a broadcast to continue the project.


Programming is an art...
Goodbye, Scratch. I am leaving because of the exams coming up at our school, though I'll check the forums once or twice a week.

Offline

 

#4 2012-03-02 21:18:18

turkey3
Scratcher
Registered: 2011-12-04
Posts: 500+

Re: Color Picker-Help mee!

videogame9 has my quote as his signature. Trust me, it was a typo. I was on my ipod and it automatically changes the word if you mess up, and it somehow changed it to death

Offline

 

#5 2012-03-02 21:48:07

Mokat
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: Color Picker-Help mee!

ProgramCAT wrote:

Here's a useful script from this thread...

HD123 wrote:

Here is a simple script to make an all-color color picker.

set [left_edge_x v] to [-240]
set [height v] to [150]
set [width v] to [150]
repeat (height)
pen down
repeat (width)
change x by [1]
change pen color by ([200]/(width))
end
pen up
set x to (left_edge_x)
change y by [-1]
change pen shade by ([100]/(height))
end
Change the width variable to change width, height variable to change height.  Put in the x coordinate you want for the left edge of your color picker in the left_edge_x variable.  Put this entire script in a 1px black dot.  After the script, you should probably add a broadcast to continue the project.

I don't understand the script... I want the scripts for so that the color picker works like the color picker in the paint editor and it sets the pen color to the color that you clicked on.  hmm


http://www.eggcave.com/egg/977371.pnghttp://www.eggcave.com/egg/977376.pnghttp://www.eggcave.com/egg/1005291.pnghttp://www.eggcave.com/egg/996745.png

Offline

 

#6 2012-03-02 22:07:38

ProgramCAT
Scratcher
Registered: 2011-12-13
Posts: 500+

Re: Color Picker-Help mee!

I don't think you can.


Programming is an art...
Goodbye, Scratch. I am leaving because of the exams coming up at our school, though I'll check the forums once or twice a week.

Offline

 

#7 2012-03-03 05:14:19

Servine
Scratcher
Registered: 2011-03-19
Posts: 1000+

Re: Color Picker-Help mee!

You can, I've done it. I'll make an example of it for you later today!


http://bluetetrarpg.x10.mx/usercard/?name=Servine

Offline

 

#8 2012-03-03 05:56:22

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Color Picker-Help mee!

This mock paint editor by me uses it: Whizz Paint.
The color selection script + a way to have gradients can be found in this mini-project.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

Board footer