Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 7:29 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: RGB > HEX?
PostPosted: May 6th, 2008, 11:36 pm 
Offline

Joined: September 30th, 2007, 7:22 pm
Posts: 2
i already created a loop to clone 10x10 frames where the user can see what colour they are choosing for their font.
I am using the the 1st child (of the clone) to store the the RGB value of the colour of each frame.

Iam trying to make this selection to effect the font colour in a normal text area.
Now my problem is this:
    the .SetBackground() works with RGB decimal numbers ie RGB(255,255,255) and...
    the .colour = RGB() [with SetSelectionStyle() attribute] works in Hex ie FFFFFF

Is there a way, without coding a hex converter, that i can wither convert the RGB decimal value to a RGB hex value?
Or even getting the background colour of the users selection?
or is there a method of converting the font colour using a RGB decimal value?

Cheers for any help,
Mike


        Top
         Profile  
         
         Post subject:
        PostPosted: May 7th, 2008, 12:53 am 
        Offline
        Godlike
        Godlike

        Joined: November 12th, 2005, 1:56 am
        Posts: 1474
        Location: SFBay Area
        Opus: OpusPro v9.0x, & Evol.
        OS: Vista32
        System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
        Mike,

        That's a good question.
        You can see the 'html string' for color when picking it in the dialog that Opus uses in its EDITOR. But almost all the references ( I've seen ) in Opus commands stick with RGB or colourname.


        Quote:
        Or even getting the background colour of the users selection?
        Take a look at one of the Sample Publications "Opus v6 New Features". In there is a demo Page for color swatch demo which might answer this. Another page brings up 'picker' for User...by calling a DLL. I think the DLL is DW's own and not a windows tool.

        Quote:
        convert the RGB decimal value to a RGB hex value? or, is there a method of converting the font colour using a RGB decimal value?

        I don't know.
        Others may have some answers.


        Try a Search in this forum for RGB and see what you come up with.

        You probably already have a cross-reference. But while we're on the subject, others may find these links useful --- a couple 'color' pages. One has some suggested VB code for a converter ( don't know if that could be adapted in Opusscript... anyone?). I'd also note that Opus seems to take only the "basic 16" colornames (and the DW folks like to say "colour"... odd behavioUr that.)
        http://tinyurl.com/63q6hm from www.globalvillage.net Web-Safe-Color-Chart

        http://www.tek-tips.com/viewthread.cfm? ... 29&page=10 (VB code mid-page)


        So, Welcome to the Forum and all the fun of Opus creativity. Do check back for more reply posts and ideas... they tend to build here. Also, please let us know at the end what you find that works.

        Cheers.

        _________________
        _good things come to those who wait(0)_


        Top
         Profile  
         
         Post subject:
        PostPosted: May 7th, 2008, 2:18 am 
        Offline

        Joined: November 11th, 2004, 4:05 am
        Posts: 636
        Location: Christchurch, NZ
        Converting from the RGB triplet to the Hex equivalent and back again is not difficult. See attached.
        Hit F5 and example output is visible in the Debug console.

        Or, if you want to work on each triplet one at a time, you can convert from hex to decimal easily using parseInt.

        parseInt("FF",16) will return 255, etc.

        Paul


        Top
         Profile  
         
         Post subject:
        PostPosted: May 7th, 2008, 9:55 pm 
        Offline

        Joined: September 30th, 2007, 7:22 pm
        Posts: 2
        thank you for your replies
        it is worth noting (i forgot to mention) that i am currently using opus xe v5.5 for any further replies
        though since i'm looking to upgrade to v6 soon so either referance is fine

        as for the 'color to colour' referance i can only assume that opus script was developed by a UK based company as they (we) spell [us=] color as colour ;)


        Top
         Profile  
         
        Display posts from previous:  Sort by  
        Post new topic Reply to topic  [ 4 posts ] 

        All times are UTC [ DST ]


        Who is online

        Users browsing this forum: No registered users and 52 guests


        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 post attachments in this forum

        Search for:
        Jump to:  
        cron
        Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group