Simplicty and flexibility!

DataEase 8.2 - SetColor() updated with Decimal Interpretation R255G128 etc... (Ver.

Started by DataEase
You will need to Sign In to be able to comment on the Blog!

DataEase 8.2 - SetColor() updated with Decimal Interpretation R255G128 etc... (Ver.

It was pointed out to us that we might have been to technical and not particularly user friendly when we designed the SetColor() function.

After a lot of protesting, soul searching and deliberation and with the weight of tradition heavy on the shoulder we almost managed to make our esteemed previous leaders our own.... "As designed!"

It would have been the truth, but sadly the customer was right - it was rather inconsistent.

To our defence we might add that it was our first SetClass function so we hadn't really got the hang of it but...

When we created it we were just happy that it worked,but we quickly realised that using a number between 0 and 65535 to describe a mix of Red, Blue and Green wasn't very useful so we settled for the way that felt natural for us - Hex. The colour is built up by (really 4 but we don't include the hue here) 3 bytes after each other that each give the element of each colour you can very easily represent it in hex #000000 to #ffffff. where two letters each represent one byte (colour). Converting this number into Decimal however is Nonsense!!!

If we are to use Decimal we need to use Decimal pr. element and that is what our brilliant customer pointed out to us.

We felt that Hex was brilliant (and it is) because that is what you use on web, get from PhotoShop etc and you get it as one "string". Decimal is three numbers independently which is of course a lot of hassle...

The convincing blow though was that OUR Pallet "Widget" does not give you the Hex value but only the Decimal interpretation pr. colour!

So here we go!

SetColor("MyObject","R128G300B330" etc.

if you only want red you can lave the other two out etc.

You can mix hex and decimal in the function but not in a colour.


Will give you a red font, a green fill (background) and a blue border.

The rest I guess you can figure out.

Written by DataEase 19/11/14 at 16:51:31 Dataease [{8}]FIVE