473,320 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

RGB Sliders/Pickers

Hi this is my first post and i hope that am displaying correct information to post standards.

in short i am using a rgb picker used from this tutorial

http://blog.paranoidferret.com/index...-color-picker/

my main goal is to simply extract the hex value and make an alert out of it.

---

[HTML]<input size="8" id="hexBox" onchange="hexBoxChanged();" type="text">

function redBoxChanged(e)
{
currentColor.SetRGB(parseInt(document.getElementBy Id("redBox").value), currentColor.Green(), currentColor.Blue());
colorChanged("box");
}

var HexValue = document.getElementById(hexBox).getValue;

function TellMe()
{
alert(+HexValue)
}
[/HTML]
---

giovanni
Oct 15 '07 #1
13 1926
acoder
16,027 Expert Mod 8TB
Welcome to TSDN!

Try:
Expand|Select|Wrap|Line Numbers
  1. function hexboxChanged() {
  2.  alert(document.getElementById('hexBox').value);
  3. }
Oct 15 '07 #2
Welcome to TSDN!

Try:
Expand|Select|Wrap|Line Numbers
  1. function hexboxChanged() {
  2.  alert(document.getElementById('hexBox').value);
  3. }
ty acoder. and thanks for speedy reply. :D


i just realized that i forgot to add another string of code

Expand|Select|Wrap|Line Numbers
  1. var HexValue = "#123456";
  2. TNTDoCommand('SceneGraph.Objects(*).SetColorTint('+HexValue+')');
i am working at a 3d design agency which deals in real time interactive models which runs online.

the "TNTDoCommand" string wildcards all objects created in the scene, and end desire is to change colour tint to those objects or specific ones later. using the colour picker user can pick new value and "var HexValue" will be updated and applyed.
Oct 16 '07 #3
acoder
16,027 Expert Mod 8TB
Replace
Expand|Select|Wrap|Line Numbers
  1. var HexValue = "#123456";
with
Expand|Select|Wrap|Line Numbers
  1. var HexValue = document.getElementById('hexBox').value;
Oct 16 '07 #4
i shall try give it a try later. think i did try that code but never put ' in them...
Oct 16 '07 #5
tried that code and still no luck

have cleaned out some code and somehow lost some posting for files. unless im going crazy. but think it was just links above.

could i send you a copy of the code? i put it all into a single file. tried sending it to you via email but admin only

saw additional options of uploading files so uploaded a zip file.
Attached Files
File Type: zip rgb picker.zip (4.8 KB, 86 views)
Oct 16 '07 #6
acoder
16,027 Expert Mod 8TB
What's supposed to happen in the attached example file?
Oct 16 '07 #7
What's supposed to happen in the attached example file?
the attached is the code i am using (cleaned of code unrelated to the picker). i know there are other id's which i could you

ie
Expand|Select|Wrap|Line Numbers
  1. var hexValue = redBox +  greenBox + blueBox;
or something else which i dont see...
Oct 17 '07 #8
acoder
16,027 Expert Mod 8TB
You have a number of "failed attempts" in the source code. What is supposed to be retrieved for colorValue?
Oct 17 '07 #9
hhmmm... ill redo the code then ill post a new updated version. ill try and find and clean those bugs... thx acoder

ps might be while till next post
Oct 18 '07 #10
acoder
16,027 Expert Mod 8TB
hhmmm... ill redo the code then ill post a new updated version. ill try and find and clean those bugs... thx acoder
The "failed attempts" were all commented out anyway but I was wondering what colorValue was unless it was an old name for hexValue.
Oct 18 '07 #11
The "failed attempts" were all commented out anyway but I was wondering what colorValue was unless it was an old name for hexValue.
hexValue or colorValue = rgb hex value...

probably a line i forgot to change... sorry about that.
Oct 18 '07 #12
acoder
16,027 Expert Mod 8TB
When is the lightMode function called?

When do you want to use this hex value? Do you use a button that has to be clicked to decide what colour has been chosen?
Oct 18 '07 #13
i plan on adding code (check boxes) which will call certain objects in scene.

if (eg a-e) is picked catagory a is selected and if more than one selected does changes to all...

i made rough code but i know it doesnt work but ill explain after quote
Expand|Select|Wrap|Line Numbers
  1. var a = false;
  2. var b = false;
  3. var c = false;
  4.  
  5. function lightMode () {
  6.     if (a == true) {
  7.         TNTDoCommand('Scenegraph.Objects("agroup*").SetColourTint('+hexValue+')');
  8.         }
  9.     if (b == true) {
  10.         TNTDoCommand('Scenegraph.Objects("bgroup*").SetColourTint('+hexValue+')');
  11.         }
  12.     if (c == true) {
  13.         TNTDoCommand('Scenegraph.Objects("cgroup*").SetColourTint('+hexValue+')');
  14.         }
  15.     else {
  16.         //do nothing
  17.         }
  18. }
  19.  
  20. /*
  21. if checkbox a selected
  22.     var a = true;
  23.     same case to var b and c
  24. */
check boxes for linked to object groups (agroup*; bgroup*; cgroup*;)
when checkbox selected set var a/b/c = true; then triggers lightmode
as the hexvalue changes reactivates lightmode and recolours object group

unfortunately work has been pulling me away from this code so havent written any solid code for this scenario...
Oct 18 '07 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jason Charalambides | last post by:
Could someone please tell me how I can get a slider disabled? I click on "enable" and turn it to "false", I save my project, I close the VB6, then when I open it the next day, the sliders are...
3
by: adam.sherratt | last post by:
Ayup! I am currently working on a Capacity Planning project for my office, and i'm interested to hear your thoughts on the best way to approach something. here's the scenario; The...
2
by: Need Helps | last post by:
The example given in msdn.com on how to create a Date Time Picker involves using the CreateWindowEx function. However, I created a dialog box using the graphical interface, and then used the...
3
by: Darhl Thomason | last post by:
I'm building a database application that has a number of date fields in it. When I add the date/time picker control to my form and run it, if the field is null in my db, then it shows the current...
1
by: Dica | last post by:
i need a control for a .net 2.0 web app that divides the page into two panels, the first of which should have a horizontal slider should the content become too wide to fit in the allowed width of...
0
by: WLigtenberg | last post by:
Hi, I'm looking for a Scale like Tkinter widget that has two sliders, so that the user can select both the upper and lower bound of some dataset. Much like the widgets used in spotfire:...
0
by: wishbone34 | last post by:
I have come across a problem when using JSlider: I Know how to use sliders, the rest of my code has a few other sliders, they all work fine, but for this slider, when I use the setValue function, it...
2
by: djpaul | last post by:
Hello! I am creating a program where i can fill in a list of open/close times. In total i have 14 datetimepickers which i set to custom format with hours and minutes. Every dtpicker has an name...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.