Re: translating a color name to RGB triplet
Ken, I took care to notice that gem of scripting the first time you mentioned it. It also has the benefit of being able to reconcile new colornames (if Rev ever adds them). -Chipp ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: translating a color name to RGB triplet
This appears to work in the IDE: put revNumberToColor(249,232,210) I haven't tested it in a standalone. To create a function that uses an array, use the properties cRevColorTranslation and cRevColorTranslation2 of stack revlibrary (or test if above function works in a standalone). Best regards, Mark -- Economy-x-Talk Consultancy and Software Engineering http://economy-x-talk.com http://www.salery.biz Get your store on-line within minutes with Salery Web Store software. Download at http://www.salery.biz Op 8-sep-2006, om 14:32 heeft KALANGI Vijay BABU het volgende geschreven: Hi All, Can somebody suggest me a way to translate a color name to RGB triplet Thanks in advance Bubye Vijay. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: translating a color name to RGB triplet
Stephen- Friday, September 8, 2006, 12:29:41 PM, you wrote: somewhere within the bowels of Rev must be a way to convert this directly. From Mark Waddingham earlier this year: In terms of the colours themselves, then they come from the standard X11 named colour table. One reference for this is at: http://www.febooti.com/products/iezoom/online-help/html-color-names-x11-color-chart.html You can access the full list from within Revolution by using the colorNames function. -- -Mark Wieder [EMAIL PROTECTED] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: translating a color name to RGB triplet
Mark- Saturday, September 9, 2006, 2:54:15 AM, you wrote: This appears to work in the IDE: put revNumberToColor(249,232,210) Interesting. I had no idea revNumberToColor() and revColorToNumber() existed... I can see why they're not documented, though... put revColorToNumber(squirrel) returns AliceBlue,239,247 -- -Mark Wieder [EMAIL PROTECTED] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: translating a color name to RGB triplet
Somehow the thread has been lost. The colornames does not give a list of the color RGB triad, just the names themselves. In the user-accessible, documented Rev world, there is no way shown to CONVERT from color name to RGB triad and vice-versa. This is what I was looking for. Mark Schonewille's suggestion of using revNumbertoColor() appears to be the hidden function to do this. It needs to be tested to see if it works in a standalone. Otherwise, one might have to dig into a revLib. Grabbing the X11 list (with decimal RGB triad), putting it into a custom property, turning it into an array, and using it to cross-reference is really a workaround, reinventing the wheel, as I knew using other commands in Rev that used this conversion lived somewhere in REV. This method is covered well in earlier posts by Eric Chatonet: About colours convert functions you could have a look at this post: http://lists.runrev.com/pipermail/use-revolution/2005-May/058259.html The list of the color names/RGB values are here: Part1: http://article.gmane.org/gmane.comp.ide.revolution.user/58156/match=color+names+chatonet Part2: http://article.gmane.org/gmane.comp.ide.revolution.user/58157/match=color+names+chatonet Stephen- Friday, September 8, 2006, 12:29:41 PM, you wrote: somewhere within the bowels of Rev must be a way to convert this directly. From Mark Waddingham earlier this year: In terms of the colours themselves, then they come from the standard X11 named colour table. One reference for this is at: http://www.febooti.com/products/iezoom/online-help/html-color-names-x11-color-chart.html You can access the full list from within Revolution by using the colorNames function. -- -Mark Wieder -- stephen barncard s a n f r a n c i s c o - - - - - - - - - - - - ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: translating a color name to RGB triplet
Ok, test done. These internal functions don't even agree with each other. AND they don't show up in a standalone. Many of the color names don't come back the same. Verdict: Use the colornames for official names, but make up your own array or conversion table for any translation, i.e. the Eric Chatonet method. The internal calls are not reliable. I wouldn't bother with trying to pull it from rev libraries. The array method will also return empty if the color name isn't found, not a guess. note the discrepancies below: Name from colornames(),revColorToNumber(colorname),revNumberToColor(RGBtriad from revColorToNumber) Aquamarine3 = 102,205,170 = MediumAquamarine Azure1 = 239,255,255 = Azure Chartreuse1 = 127,255,0 = Chartreuse Chocolate4 = 126,49,23 = SaddleBrown Coral1 = 247,101,65 = Coral CornSilk1 = 255,247,215 = CornSilk DarkOrange1 = 248,114,23 = Chocolate1 DarkOrange2 = 229,103,23 = Chocolate2 DarkOrange3 = 195,86,23 = Chocolate3 DarkOrange4 = 126,49,23 = SaddleBrown DarkSalmon = 225,139,107 = Salmon Firebrick3 = 193,27,23 = Red3 Firebrick4 = 126,5,23 = Brown4 Gray0 = 0,0,0 = Black Gray1 = 21,5,23 = Transparent Gray10 = 21,5,23 = Transparent Gray100 = 255,255,255 = White Gray11 = 21,5,23 = Transparent Gray12 = 21,5,23 = Transparent Gray13 = 21,5,23 = Transparent Gray14 = 21,5,23 = Transparent Gray15 = 21,5,23 = Transparent Gray16 = 21,5,23 = Transparent Gray17 = 21,5,23 = Transparent Gray19 = 37,5,23 = Gray18 Gray2 = 21,5,23 = Transparent Gray20 = 37,5,23 = Gray18 Gray22 = 43,27,23 = Gray21 Gray3 = 21,5,23 = Transparent Gray33 = 70,62,65 = DimGray Gray66 = 160,159,157 = LightGray Gray9 = 21,5,23 = Transparent Gray96 = 244,244,243 = WhiteSmoke IndianRed4 = 126,34,23 = Tomato4 Ivory1 = 255,255,238 = Ivory LightCyan1 = 224,255,255 = LightCyan Magenta4 = 125,27,126 = DarkOrchid NavyBlue = 0,0,128 = Navy OrangeRed4 = 126,5,23 = Brown4 PaleGreen2 = 144,238,144 = LightGreen Red4 = 126,5,23 = Brown4 SeaGreen4 = 46,139,87 = SeaGreen Tan3 = 197,119,38 = Peru Tan4 = 127,72,23 = Orange4 Yellow1 = 255,255,0 = Yellow sqb Mark- Saturday, September 9, 2006, 2:54:15 AM, you wrote: This appears to work in the IDE: put revNumberToColor(249,232,210) Interesting. I had no idea revNumberToColor() and revColorToNumber() existed... I can see why they're not documented, though... put revColorToNumber(squirrel) returns AliceBlue,239,247 -- -Mark Wieder [EMAIL PROTECTED] -- stephen barncard s a n f r a n c i s c o - - - - - - - - - - - - ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: translating a color name to RGB triplet
On 9/9/06 12:34 PM, Stephen Barncard [EMAIL PROTECTED] wrote: Somehow the thread has been lost. The colornames does not give a list of the color RGB triad, just the names themselves. In the user-accessible, documented Rev world, there is no way shown to CONVERT from color name to RGB triad and vice-versa. This is what I was looking for. Actually there is one that is documented (per se), that I suggested earlier, but it is not user-accessible (meaning you can't search for 'convert color name to RGB' in the Rev docs and find it): You need to have a graphic object (like a square) and then execute this (I called my graphic ColorHolder): function getRGB pColorName put the long id of grc ColorHolder into tObj set the backColor of tObj to pColorName set the backPixel of tObj to (the effective backPixel of tObj) return (the backColor of tObj) end getRGB Basically if you set the color of a graphic object to the color name, you can then retrieve the color value of the color. Ken Ray Sons of Thunder Software Web site: http://www.sonsothunder.com/ Email: [EMAIL PROTECTED] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: translating a color name to RGB triplet
There is no direct way. So you either have to set some objects color and retrieve it (locking the screen). Or you have to construct an array or lookup table in advance and store this somewhere. The former works fine even if ugly. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: translating a color name to RGB triplet
On 9/8/06 7:32 AM, KALANGI Vijay BABU [EMAIL PROTECTED] wrote: Hi All, Can somebody suggest me a way to translate a color name to RGB triplet Well you need to have a graphic object (like a square) and then execute this (I called my graphic ColorHolder): function getRGB pColorName put the long id of grc ColorHolder into tObj set the backColor of tObj to pColorName set the backPixel of tObj to (the effective backPixel of tObj) return (the backColor of tObj) end getRGB HTH, Ken Ray Sons of Thunder Software Web site: http://www.sonsothunder.com/ Email: [EMAIL PROTECTED] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
RE: translating a color name to RGB triplet
Vijay, Just type COLORPICKER into the Google Search window on your web browser and take your PICK. Barry Barber ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: translating a color name to RGB triplet
KALANGI Vijay BABU [EMAIL PROTECTED] wrote: Can somebody suggest me a way to translate a color name to RGB triplet you may also peek at Color Names Reference under Help/Quick Reference Guides and see how they translate... ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: translating a color name to RGB triplet
somewhere within the bowels of Rev must be a way to convert this directly. I know you can input colornames to 'Answer Color' answer color with AliceBlue put it into fld output2 (it contains 239,247,255) and of course this works - set the backgroundcolor of btn toadMeat to LightYellow but when you get the color back from the object get colors of btn toadMeat) replace numToChar(11) with return in x put it into fld output2 you can see AliceBlue in line 3 in fld output2. (I was hoping to see the numbers!!) hidden table or property? KALANGI Vijay BABU [EMAIL PROTECTED] wrote: Can somebody suggest me a way to translate a color name to RGB triplet -- stephen barncard s a n f r a n c i s c o - - - - - - - - - - - - ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: translating a color name to RGB triplet
On 9/8/06 2:29 PM, Stephen Barncard [EMAIL PROTECTED] wrote: somewhere within the bowels of Rev must be a way to convert this directly. I know you can input colornames to 'Answer Color' answer color with AliceBlue put it into fld output2 (it contains 239,247,255) and of course this works - set the backgroundcolor of btn toadMeat to LightYellow but when you get the color back from the object get colors of btn toadMeat) replace numToChar(11) with return in x put it into fld output2 you can see AliceBlue in line 3 in fld output2. (I was hoping to see the numbers!!) Very interesting! If you do the same thing with a graphic, you get the RGB values back... how odd! Ken Ray Sons of Thunder Software Web site: http://www.sonsothunder.com/ Email: [EMAIL PROTECTED] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution