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
4 1754
This is in the wrong forum. It belongs in Access. My apologies. Thank you.
Nepomuk 3,112
Recognized Expert Specialist
No problem, I've moved to the Access Forum it for you.
Greetings,
Nepomuk
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: - Dim lngRetVal As Long
-
-
lngRetVal = RGB(255, 0, 255)
-
-
Debug.Print lngRetVal
-
-
'Set the BackColor of the Detail Section of a Form to Magenta
-
Me.Section(acDetail).BackColor = lngRetVal
OUTPUT: P.S. - Reference the Help Files for further information.
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
Sign in to post your reply or Sign up for a free account.
Similar topics |
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
|
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...
|
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>
|
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
|
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...
| |
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
|
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...
|
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...
|
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;
|
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" ?
|
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...
| |
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. ...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |