RGB values for a color name

10 messages Options
Embed this post
Permalink
James Hurley

RGB values for a color name

Reply Threaded More More options
Print post
Permalink
How do I translate a color name (Blue1 for example) into its RGB  
values? Programatically.

Jim Hurley
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Richmond Mathewson-2

Re: RGB values for a color name

Reply Threaded More More options
Print post
Permalink
Here we go:

Clunky, but it works (err, that's my methodology):

Make a stack; create a graphic (from the drop-down menu), call it "KOLOR".

Populate a text field "KNAMES" with colorNames:

put the colorNames into fld "KNAMES"

make two other flds:

"fRGB"  and "SELECT"

(sorry about the screwy names, but was working at speed)

bung this code in the script of the text field filled with the colorNames:

on mouseDown
  get the clickText
  put the clickText into fld "SELECT"
  set the backgroundColor of grc "KOLOR" to the clickText
  put the colors of grc "KOLOR" into fld "fRGB"
end mouseDown

Bob's your uncle!

And if that's too much bother, I've just uploaded all that here:

http://mathewson.110mb.com/FILEZ/COLORNAMER.rev.zip

at a 4 KB download it shouldn't hurt too much!

Love, Richmond.



James Hurley wrote:

> How do I translate a color name (Blue1 for example) into its RGB
> values? Programatically.
>
> Jim Hurley
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Phil Davis-5

Re: RGB values for a color name

Reply Threaded More More options
Print post
Permalink
In reply to this post by James Hurley
Depending on your use, maybe this will help:

  set the backgroundColor of control <yourColorObject> to "gray40"
  set the screenMouseLoc to globalLoc(the loc of <yourColorObject>)
  put the mouseColor -- puts "102,102,102"

Judging from this and Richmond's reply, it appears you have to do the
name-to-triplet translation indirectly, through the setting and getting
of an object's properties. But maybe someone else will pipe in...

Phil Davis



James Hurley wrote:
> How do I translate a color name (Blue1 for example) into its RGB
> values? Programatically.
>
> Jim Hurley

--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
viktoras d.

Re: RGB values for a color name

Reply Threaded More More options
Print post
Permalink
In reply to this post by James Hurley
what abou this: http://www.w3schools.com/HTML/html_colornames.asp ?

well you'll have to translate color names from hex, make an name-rgb
array and get value for name (put array[color_name] into rgb).

Viktoras

James Hurley wrote:

> How do I translate a color name (Blue1 for example) into its RGB
> values? Programatically.
>
> Jim Hurley
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Richmond Mathewson-2

Re: RGB values for a color name

Reply Threaded More More options
Print post
Permalink
In reply to this post by Phil Davis-5
Phil Davis wrote:
> Depending on your use, maybe this will help:
>
>  set the backgroundColor of control <yourColorObject> to "gray40"
>  set the screenMouseLoc to globalLoc(the loc of <yourColorObject>)
>  put the mouseColor -- puts "102,102,102"
>
> Judging from this and Richmond's reply, it appears you have to do the
> name-to-triplet translation indirectly, through the setting and
> getting of an object's properties. But maybe someone else will pipe in...

Ha, Ha, I was suffering from a bad dose of over-confidence there,
because, if you read the Documentation under COLORS:

"A color reference is any standard color name; or three comma-separated
integers between zero and 255, specifying the level of each of red,
green, and blue; or an HTML-style color consisting of a hash mark (#)
followed by three hexadecimal numbers, one for each of red, green, and
blue."

There seems no obvious way to get  the RGB reference rather than the name.

The stack I just popped off just gives me the standard color name again.

>
> Phil Davis
>
>
>
> James Hurley wrote:
>> How do I translate a color name (Blue1 for example) into its RGB
>> values? Programatically.
>>
>> Jim Hurley
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Richmond Mathewson-2

Re: RGB values for a color name

Reply Threaded More More options
Print post
Permalink
In reply to this post by Phil Davis-5
Aha, gottit (Thanks for the hint Phil); new version now available at:

http://mathewson.110mb.com/FILEZ/COLORNAMER.rev.zip

Code in list field "KNAMES" changed to:

on mouseDown
  get the clickText
  put the clickText into fld "SELECT"
  set the backgroundColor of grc "KOLOR" to the clickText
end mouseDown

but script now added to graphic "KOLOR":

on mouseDown
  put the mouseColor into fld "fRGB"
end mouseDown

so, select your color with its "Campy, House Designer Color" from the
list field; then click on the colored graphic to get its RGB value.

Cripes, its way past my bedtime . . . Love, Richmond.

Phil Davis wrote:

> Depending on your use, maybe this will help:
>
>  set the backgroundColor of control <yourColorObject> to "gray40"
>  set the screenMouseLoc to globalLoc(the loc of <yourColorObject>)
>  put the mouseColor -- puts "102,102,102"
>
> Judging from this and Richmond's reply, it appears you have to do the
> name-to-triplet translation indirectly, through the setting and
> getting of an object's properties. But maybe someone else will pipe in...
>
> Phil Davis
>
>
>
> James Hurley wrote:
>> How do I translate a color name (Blue1 for example) into its RGB
>> values? Programatically.
>>
>> Jim Hurley
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Francis Nugent Dixon

Re: RGB values for a color name

Reply Threaded More More options
Print post
Permalink
In reply to this post by James Hurley
Hi James,

I  have a nice little stack that allows you
to play around with colours,search for new
colors and save them, give hex equivalents
of RGB values, export colour values to the
clipboard, everything you need, including
your requirements.

Send me a request off-forum.

This offer is, of course, open to all !

Best Regards

-Francis

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Paul Foraker

re: RGB values for a color name

Reply Threaded More More options
Print post
Permalink
In reply to this post by James Hurley
I've put up a one-card stack at

http://www.whitefeather.com/tools/colormehexed/

which consolidates some color management stuff I've been working on for the
past several months. Jacque Gay, Alex Tweedly, and Chipp Walters were
unwitting contributors. (Advisory: I haven't looked at this stack on
Windows.)

My primary task has been to convert between RGB and Hex, as well as publish
HTML pages with specific colors, so that's mostly what the thing helps with,
but there is a Color Names menu.

Plus, the Apple Mac OS X Color Picker (answer color) contributes some extra
help. Today, I found a really excellent article on that Color Picker by
Robin Wood

http://www.robinwood.com/Catalog/Technical/OtherTuts/MacColorPicker/MacColorPicker.html

which suggests much more that could be done!

-- Paul
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Randall Reetz

RE: RGB values for a color name

Reply Threaded More More options
Print post
Permalink
In reply to this post by James Hurley
I will look at it.  But my work has nothing to do with manual user color management.  I am working on deeply semantic pattern logic.  I think it is way past time for computers to know enough to try to know.  Crazy to have all of this computational power and for it to do no more than it did 20 years ago (just faster).  My code needs to know in dreadfully simple and obvious terms what a color of a pixel and how that changes as one moves away from it.  This is to imagery what phonems are to spoken language.  I really dont care what color a pixel has, just how that is different from other pixels near by.  I need as much that i can compare as posible,  Knowing the hue and the brightness is a start.  I would like to know the minimum noumber of pure colors it would take to make that pixels color... To colors what factoring is to numbers.  That would help.  Not with the primary colors.  Cause that seems realy arbitary (and yes i have heard of newton).   Anyway, i am convinced that i can do enough with hue and brightness for a start, what i might have to do is distill just the color component from RGB but keep it in three color values (just without the brightness component).  I will work on it and get back to the group.

-----Original Message-----
From: "paul foraker" <[hidden email]>
To: "How to use Revolution" <[hidden email]>
Sent: 7/5/2009 5:57 PM
Subject: re: RGB values for a color name

I've put up a one-card stack at

http://www.whitefeather.com/tools/colormehexed/

which consolidates some color management stuff I've been working on for the
past several months. Jacque Gay, Alex Tweedly, and Chipp Walters were
unwitting contributors. (Advisory: I haven't looked at this stack on
Windows.)

My primary task has been to convert between RGB and Hex, as well as publish
HTML pages with specific colors, so that's mostly what the thing helps with,
but there is a Color Names menu.

Plus, the Apple Mac OS X Color Picker (answer color) contributes some extra
help. Today, I found a really excellent article on that Color Picker by
Robin Wood

http://www.robinwood.com/Catalog/Technical/OtherTuts/MacColorPicker/MacColorPicker.html

which suggests much more that could be done!

-- Paul
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Randall Reetz

RE: RGB values for a color name

Reply Threaded More More options
Print post
Permalink
In reply to this post by James Hurley
Two things.  A., i was trying to fit three dimentions into one.  RGB is a good full discription of color.  You need three numbers for this.  And B., HSV is the hack.  It is lossy.  It forces full complex mixed hue into a single color point on the spectrum.  More later.

-----Original Message-----
From: "Randall Reetz" <[hidden email]>
To: "How to use Revolution" <[hidden email]>
Sent: 7/5/2009 8:54 PM
Subject: RE: RGB values for a color name

I will look at it.  But my work has nothing to do with manual user color management.  I am working on deeply semantic pattern logic.  I think it is way past time for computers to know enough to try to know.  Crazy to have all of this computational power and for it to do no more than it did 20 years ago (just faster).  My code needs to know in dreadfully simple and obvious terms what a color of a pixel and how that changes as one moves away from it.  This is to imagery what phonems are to spoken language.  I really dont care what color a pixel has, just how that is different from other pixels near by.  I need as much that i can compare as posible,  Knowing the hue and the brightness is a start.  I would like to know the minimum noumber of pure colors it would take to make that pixels color... To colors what factoring is to numbers.  That would help.  Not with the primary colors.  Cause that seems realy arbitary (and yes i have heard of newton).   Anyway, i am convinced that i can do enough with hue and brightness for a start, what i might have to do is distill just the color component from RGB but keep it in three color values (just without the brightness component).  I will work on it and get back to the group.

-----Original Message-----
From: "paul foraker" <[hidden email]>
To: "How to use Revolution" <[hidden email]>
Sent: 7/5/2009 5:57 PM
Subject: re: RGB values for a color name

I've put up a one-card stack at

http://www.whitefeather.com/tools/colormehexed/

which consolidates some color management stuff I've been working on for the
past several months. Jacque Gay, Alex Tweedly, and Chipp Walters were
unwitting contributors. (Advisory: I haven't looked at this stack on
Windows.)

My primary task has been to convert between RGB and Hex, as well as publish
HTML pages with specific colors, so that's mostly what the thing helps with,
but there is a Color Names menu.

Plus, the Apple Mac OS X Color Picker (answer color) contributes some extra
help. Today, I found a really excellent article on that Color Picker by
Robin Wood

http://www.robinwood.com/Catalog/Technical/OtherTuts/MacColorPicker/MacColorPicker.html

which suggests much more that could be done!

-- Paul
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution