Author Topic: A getpixel routine to select colors.  (Read 1903 times)

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1645
  • Particle Hawk
    • View Profile
Use the image below the code to go with this.
Yes, DDGui has a color picker too, but it is used differently.
Here, CPColor Value# is the color you pick from an external image.
Code: (glbasic) [Select]
loadsprite "colorpicker420.png",0
IF init_color=FALSE; init_color=TRUE
LOCAL  mx,my,mb1,mb2

DRAWSPRITE 0,0,0 // draw pick color image

//grab a color
MOUSESTATE mx,my,mb1,mb2
IF mb1

//show color selected box
DRAWRECT 500,100,100,100,RGB(255,255,255)
DRAWRECT 504,104,92,92,RGB(0,0,0)
DRAWRECT 504,104,92,92,CPColor

GOTO TheColor

[attachment deleted by admin]
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)