OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Old 22-02-2005, 12:43
Posts: n/a
Default CDR12 ?Bug?: HSB Colors

Make a closed-path Curve in Corel Draw
Give it a HSB Uniform fill with values:
Hue: 125
Saturation: 75
Brightness: 50

Now checkout in VBA macro
theShape.Fill.UniformColor properties
.HSBHue is 125
.HSBSaturation is 191
.HSBBrightness is 128

Can you check this by your side and suggest what to do in order to recieve proper values?
Reply With Quote
Old 22-02-2005, 13:17
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: CDR12 ?Bug?: HSB Colors

No, it is not a bug. Well, at least in some sense. S and B components internatlly are represented as values between 0 and 255. But the UI shows them as 0 to 100. It's been decided to use the internal representation for VBA properties to keep the precision. So you just need to divide the value you receive by 2.55 to get the UI value (128/2.55 = 50)

Same happens to some other color models. The wackiest I think is Lab. where A and B components are shown in dialogs as -128...+127 while VBA reports them as 0..255. "0" means -128, and 255 is +127. Apparently 128 should be displayed as 0. The Lightness (L) component is still shown as being 0...100 while the VBA returns the internal 0..255.

It is not all that complicated, but, I agree, adds some confusion to it.
Reply With Quote
Old 22-02-2005, 14:21
Posts: n/a

Thank you Alex for the enlightment
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting a list of all colors in a Document CORNMEN CorelDRAW/Corel DESIGNER VBA 5 15-11-2008 06:14
Palette (or Colors array) property in VBA class in CDR12 zlatev CorelDRAW/Corel DESIGNER VBA 7 22-02-2005 12:28
Wish to Convert Named Colors to Shape Color D_Green CorelDRAW/Corel DESIGNER VBA 1 12-09-2004 12:08
Corel V9- print only printer-safe colors using gamut alarm? Kitemaker CorelDRAW/Corel DESIGNER VBA 5 30-06-2004 17:03
How can I change middle colors in a custom Fountain Fill Steve CorelDRAW/Corel DESIGNER VBA 3 13-12-2002 20:11

All times are GMT -5. The time now is 02:52.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com