summaryrefslogtreecommitdiff
path: root/wizards/source/tools
diff options
context:
space:
mode:
authorTom Verbeek <tv@openoffice.org>2002-05-30 13:57:25 +0000
committerTom Verbeek <tv@openoffice.org>2002-05-30 13:57:25 +0000
commita63b6dd19274a2ca9b80caad9cbfad0742599bd8 (patch)
tree469ecd3f202a41440cdfeb0aefc23e698467b647 /wizards/source/tools
parentd47893d4e7d768d8e0749b23703b5a317cd848b6 (diff)
#98788# Support for High-Contrast icons
Diffstat (limited to 'wizards/source/tools')
-rw-r--r--wizards/source/tools/Misc.xba20
1 files changed, 19 insertions, 1 deletions
diff --git a/wizards/source/tools/Misc.xba b/wizards/source/tools/Misc.xba
index 19c8b6ef6989..b7f70277c1a0 100644
--- a/wizards/source/tools/Misc.xba
+++ b/wizards/source/tools/Misc.xba
@@ -715,4 +715,22 @@ Dim aSwitchMode as new com.sun.star.util.URL
Dim aEmptyArgs() as New com.sun.star.bean.PropertyValue
oDispatch.dispatch(aSwitchMode, aEmptyArgs())
Erase aSwitchMode
-End Sub</script:module>
+End Sub
+
+
+Function isHighContrast(oPeer as Object)
+ Dim UIColor as Long
+ Dim myRed as Integer
+ Dim myGreen as Integer
+ Dim myBlue as Integer
+ Dim myLuminance as Double
+
+ UIColor = oPeer.getProperty( &quot;DisplayBackgroundColor&quot; )
+ myRed = Red (UIColor)
+ myGreen = Green (UIColor)
+ myBlue = Blue (UIColor)
+ myLuminance = (( myBlue*28 + myGreen*151 + myRed*77 ) / 256 )
+ isHighContrast = false
+ If myLuminance &lt;= 25 Then isHighContrast = true
+End Function
+</script:module> \ No newline at end of file