Color Picker
Last updated
colourpicker "show"colourpicker "setpos" x ycolourpicker "setcol" #hexcodecolourpicker "getcol" // Result stored in picker_colour variable// Show the color picker
colourpicker "show"
// Position it on screen
colourpicker "setpos" 100 100
// Set initial color to red
colourpicker "setcol" #FF0000
// Get the selected color
colourpicker "getcol"
log picker_colour // Outputs the selected color
// Use the selected color
c picker_colour
rectangle 0 0 100 100 // Draws rectangle with selected color// Create a color selection interface
colourpicker "show"
colourpicker "setpos" 20 20
mainloop:
// Get current color
colourpicker "getcol"
// Use color for drawing
c picker_colour
rectangle 200 50 100 100
// Display current color value
text "Selected color: " + picker_colour