473,545 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question of Color

675 Contributor
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 1754
OldBirdman
675 Contributor
This is in the wrong forum. It belongs in Access. My apologies. Thank you.
Dec 16 '08 #2
Nepomuk
3,112 Recognized Expert Specialist
No problem, I've moved to the Access Forum it for you.

Greetings,
Nepomuk
Dec 16 '08 #3
ADezii
8,834 Recognized Expert Expert
@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 Contributor
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
3086
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
5301
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++ language. A C++ interface installation IS ABOUT THE C++ LANGUAGE! The language does not possess the ability to handle even simple file directory...
3
5008
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
2638
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 it differently. FOUR QUESTIONS: The background: I got three (3) files
11
4232
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 threads of a multithreaded program using embedded SQL. Since the threads do not need to share transaction scopes, the sqleAttachToCtx family of APIs do...
3
3066
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 before rowID answID qryrow questionID datafield 1591 12 06e 06e 06e question 1593 12 06f 06f 06f question 1594 12 answer to the question 06f
11
4355
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 questions on a survey that have a possible response range from 0-4. what I would like to do is simply show that for each question we had x amount...
10
3398
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 database or continue to process on to the next page. I am now trying to learn ASP to see if we can replace some of our applications that were written in...
53
4026
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
4715
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
7479
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7669
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7926
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7773
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4962
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.