forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Accessing windows colour wheel, and retriving hex colours.

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
LinkSisco
Valued Newbie


Joined: 17 May 2002
Posts: 30
Location: UK

PostPosted: Wed Jun 26, 2002 11:09 pm    Post subject: Accessing windows colour wheel, and retriving hex colours. Reply with quote

How can I do this, I have seen it done before but I cant find the source anymore.

Thank you.
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Wed Jun 26, 2002 11:29 pm    Post subject: Reply with quote

In vds 4, all you need to do is this:

Code:

option colordlg, hexonly

%%color = @colordlg()


Take care,

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LinkSisco
Valued Newbie


Joined: 17 May 2002
Posts: 30
Location: UK

PostPosted: Thu Jun 27, 2002 8:58 am    Post subject: Reply with quote

Thanks, but will that work in VDS3?

If not how would I do it with that?
Thanks.
Back to top
View user's profile Send private message
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Thu Jun 27, 2002 9:23 am    Post subject: Reply with quote

This should be possible using my VDSDLL V2.7:

http://www.vdsworld.com/index.php?page=download&fileid=44

Tommy
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LinkSisco
Valued Newbie


Joined: 17 May 2002
Posts: 30
Location: UK

PostPosted: Thu Jun 27, 2002 9:49 am    Post subject: Reply with quote

Thats great work Tommy, but how do I get the HEX values from the colours?

Thanks
Back to top
View user's profile Send private message
LinkSisco
Valued Newbie


Joined: 17 May 2002
Posts: 30
Location: UK

PostPosted: Thu Jun 27, 2002 12:23 pm    Post subject: Reply with quote

Please anyone how can i get the hex code???


Thought i would also mention that I need it to be web safe hex code.

Thanks...


Last edited by LinkSisco on Thu Jun 27, 2002 12:30 pm; edited 1 time in total
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Jun 27, 2002 12:27 pm    Post subject: Reply with quote

Here ya go. I think Tommy originally made this.

Code:

:Color Convert
   if @equal(%%vds,red)
      %%vds = $000000FF
   else
      if @equal(%%vds,black)
         %%vds = $00000000
      else
         if @equal(%%vds,white)
            %%vds = $00FFFFFF
         else
            if @equal(%%vds,dkred)
               %%vds = $00000080
            else
               if @equal(%%vds,dkgreen)
                  %%vds = $00008000
               else
                  if @equal(%%vds,brown)
                     %%vds = $00008080
                  else
                     if @equal(%%vds,dkblue)
                        %%vds = $00800000
                     else
                        if @equal(%%vds,magenta)
                           %%vds = $00800080
                        else
                           if @equal(%%vds,gray)
                              %%vds = $00808080
                           else
                              if @equal(%%vds,silver)
                                 %%vds = $00C0C0C0
                              else
                                 if @equal(%%vds,ltgreen)
                                    %%vds = $0000FF00
                                 else
                                    if @equal(%%vds,yellow)
                                       %%vds = $0000FFFF
                                    else
                                       if @equal(%%vds,ltblue)
                                          %%vds = $00FF0000
                                       else
                                          if @equal(%%vds,cyan)
                                             %%vds = $00FFFF00
                                          end
                                       end
                                    end
                                 end
                              end
                           end
                        end
                     end
                  end
               end
            end
         end
      end
   end
  %%vdscolor = @sum(%%vds,0)
  %%hex = @hex(%%vdscolor,Cool
  %%blue = @sum($@substr(%%hex,3,4),0)
  %%green = @sum($@substr(%%hex,5,6),0)
  %%red = @sum($@substr(%%hex,7,Cool,0)
  %%_1   = @hex(@diff(%%vds,0),Cool
  %%html = #@substr(%%_1,7,Cool@substr(%%_1,5,6)@substr(%%_1,3,4)
  info VDS color: %%vdscolor@cr()Hex color: %%hex@cr()Red: %%red@cr()Green: %%green@cr()Blue: %%blue @cr()HTML: %%HTML
exit
   


_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LinkSisco
Valued Newbie


Joined: 17 May 2002
Posts: 30
Location: UK

PostPosted: Thu Jun 27, 2002 10:35 pm    Post subject: Reply with quote

Right i have been fighing thid all night and still i have not got the result i need.

Right says i have a button and lets say its called "button". When i click the button i need it to open the windows colour picker, after the user selects a colour and clicks ok, i need the program to take the colour and convert it to the 6 value hex number used on webpages.

What code would do this?
Thanks for any help...
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Jun 27, 2002 11:17 pm    Post subject: Reply with quote

VDS 3.x does not provide direct access to Windows' color picker, so you may have a problem doing that.
VDS 4.x does, as Liquidcode states, have support for this. Just use something like this:
Code:
  option colordlg, webonly
  %%color = @colordlg()
  info %%color


It will output the color code used in HTML.

Greetz
Dr. Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
LinkSisco
Valued Newbie


Joined: 17 May 2002
Posts: 30
Location: UK

PostPosted: Fri Jun 28, 2002 9:49 am    Post subject: Reply with quote

How can I use Tommys dll to get the colour then covert it to a websafe hex code?
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Jun 28, 2002 10:12 am    Post subject: Reply with quote

How about a VDS "color picker" for HTML colors?

I posted one in the VDS3 Share Code section:

http://www.vdsworld.com/forum/viewtopic.php?p=1921#1921

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group