dbTalk Databases Forums  

Contrasting Colours

comp.databases.ms-access comp.databases.ms-access


Discuss Contrasting Colours in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Phil
 
Posts: n/a

Default Contrasting Colours - 01-14-2012 , 03:13 AM






My Post on Convert RGB Colours to HSL may well be irrelevant, so I will ask
the basic question instead of guessing the answer. I have a continuous form
based on about 15 records where, using conditional formatting, the user can
choose the background colour of a control called "CalendarShort". This is
done by double clicking the field which brings up the Colour Picker dialog
box and stores the RGB colour in the Calendar Table.
What I want to do is ensure that the ForeColor of the CalendarShort is in as
contrasting colour as possible to the Background so that it can be read
easily.

So I need some sort of function like
Function Contrast(ColIn as Long) as Long

I have a shaky function that returns either VbBlack or VBWhite, but it doesnt
always get it right, but realy need colours that stand out

I can then apply that to the conditional formating

Without going ito all the details, this bit works fine

Sub SetFormatCondCal(ChangeForeColour As Boolean)
Blah Blah
Me!CalendarShort.FormatConditions(i).BackColor i).BackColor =
CalendarSet!CalendarColour If ChangeForeColour = True Then ' Contrasting
ForColor Me!CalendarShort.FormatConditions(i).ForeColor = _
Contrast(Nz(CalendarSet!CalendarColour))
End If

Any ideas please
Phil

Any ideas please

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.