473,326 Members | 2,168 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,326 software developers and data experts.

Question of Color

675 512MB
I have 2 rectangles side-by-side and I want them to be colored.

I select both and use the Color Dialog Box to assign a color, say green with medium saturation. In other words, the scale along the right side of the dialog box is about mid-point. This gave me the BackColor = 8893580.

I now select one of the rectangles and call the color dialog again, and without changing the color (hue), I only move the pointer to a lighter (less saturated) color. This gave me 14411996. But side by side in my rectangles, this color is blue, not green. The dialog box does not give me a lighter color, but a different color.

I would like an algorithm to change the saturation of any color while preserving the hue. It doesn't have to be a dialog box.

Thank you
OldBirdman
Dec 16 '08 #1
4 1744
OldBirdman
675 512MB
This is in the wrong forum. It belongs in Access. My apologies. Thank you.
Dec 16 '08 #2
Nepomuk
3,112 Expert 2GB
No problem, I've moved to the Access Forum it for you.

Greetings,
Nepomuk
Dec 16 '08 #3
ADezii
8,834 Expert 8TB
@OldBirdman
Try experimenting with the RGB() Function which returns a Long whole number representing an RGB color value, and can represent 16,000,000+ color variations. The syntax is:

RGB(red, green, blue) where the red, green , and blue Arguments have values between 0 and 255. It's getting near bedtime, so I'll just post a simple code example of its use:
Expand|Select|Wrap|Line Numbers
  1. Dim lngRetVal As Long
  2.  
  3. lngRetVal = RGB(255, 0, 255)
  4.  
  5. Debug.Print lngRetVal
  6.  
  7. 'Set the BackColor of the Detail Section of a Form to Magenta
  8. Me.Section(acDetail).BackColor = lngRetVal
OUTPUT:
Expand|Select|Wrap|Line Numbers
  1. 16711935
P.S. - Reference the Help Files for further information.
Dec 17 '08 #4
OldBirdman
675 512MB
This question is not about what the single number representing color means, nor how to generate it. It is about finding an algorithm to change intensity without changing hue.
I tried to write an algorithm to lighten the color by 50%, and although slightly better than the MS color dialog, still altered the hue.
Using RGB is trial & error, which I am now doing with the color dialog box.

I started a program using sliders to generate values to run thru my algorithm quickly, displaying the colors in rectangles. Then I would not have to do so much cut&paste, but I get messages "The expression Change you entered as the event property setting produced the following error: There was an error loading an ActiveX control . . .

Altho I might like to figure this out, I don't want to get distracted here with ActiveX controls, which I can never make work, which is another topic. So I'm looking for an algorithm that I could put in a global procedure to call from the immediate window.

I am working on another algorithm now, but was hoping this had already been done.

OldBirdman
Dec 17 '08 #5

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

Similar topics

1
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
65
by: perseus | last post by:
I think that everyone who told me that my question is irrelevant, in particular Mr. David White, is being absolutely ridiculous. Obviously, most of you up here behave like the owners of the C++...
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
11
by: Mark Yudkin | last post by:
The documentation is unclear (at least to me) on the permissibility of accessing DB2 (8.1.5) concurrently on and from Windows 2000 / XP / 2003, with separate transactions scope, from separate...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
11
by: NC Tim | last post by:
Hello, I think the question i have is fairly straightforward, but I can't seem to replicate the old SAS frequency procedure when I try to accomplish this in MS Access. anyway, i have about 10...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
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...
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: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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.