Recent

Author Topic: [Solved] Using TColorRec colors for bar series  (Read 1170 times)

rvk

  • Hero Member
  • *****
  • Posts: 5017
Re: Using TColorRec colors for bar series
« Reply #15 on: July 26, 2022, 09:33:57 pm »
But somehow they didn't include this fix in latest 3.2.2 version, which released several months after in May 22.
A stable release is frozen long before the actual release date.
I think some fixes are stil applied to it but not all.
It's not like 3.2.2 stable release is exactly like trunk version of May 22.
It's branched off a much earlier version.
At least that's my understanding.

https://www.freepascal.org/faq.var#versions
https://wiki.freepascal.org/Version_Numbering

O, and BTW... FPC 3.2.2 has been released on May 20th, 2021.
So before 28-12-2021 when this change was made.
https://wiki.freepascal.org/FPC_New_Features_3.2.2


« Last Edit: July 26, 2022, 09:41:04 pm by rvk »

artem101

  • Jr. Member
  • **
  • Posts: 53
Re: Using TColorRec colors for bar series
« Reply #16 on: July 27, 2022, 09:39:25 am »
If you want to convert the second to the first you have to swap the TColor (32 bit DWord)

Swap function not suitable for this task. It swaps first 2 bytes and last 2 bytes, but I need to swap only second and fourth bytes (Blue and Red values):
Code: Pascal  [Select][+][-]
  1. Constant  | TColor
  2. ---------------------
  3. 0RGB      | 0BGR
  4. $00DC143C | $003C14DC
  5.                ^^--^^

I made this with code:
Code: Pascal  [Select][+][-]
  1. function FixColorConstant(AColor: TColorRec): TColor;
  2. begin
  3.   {$if defined(FPC_FULLVERSION) and (FPC_FULLVERSION <= 030202)}
  4.   Result := RGBToColor(AColor.B, AColor.G, AColor.R);
  5.   {$ELSE}
  6.   // ToDo: Check if it fixed in modern version
  7.   Result := AColor;
  8.   {$ENDIF}
  9. end;        
  10.  

 

TinyPortal © 2005-2018