Recent

Author Topic: HTMLtoRGBA  (Read 368 times)

winni

  • Hero Member
  • *****
  • Posts: 592
HTMLtoRGBA
« on: October 27, 2019, 01:19:11 am »
@circular

For years I use my own function  HTMLtoBGRA.

Now I just stumbled over TryStrToBGRA / StrToBGRA and see from the code that it is a swiss knife and  also converts HTML hex colors to BGRA.

It's nice that there is such a function but it is nowhere documented - not even in the code.

There are so many nice treasures in the lib, but the documentation - pardon Sir - is lousy.

Some vegetables to give you power for the doc: 🥑🥒🥔🥕🥖 

(just playing around with  utf8-glyphs)

Winni

circular

  • Hero Member
  • *****
  • Posts: 3053
    • Personal webpage
Re: HTMLtoRGBA
« Reply #1 on: October 28, 2019, 12:30:40 pm »
Haha thanx

Indeed documentation is not complete.

If you can help ?

Regards
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 3313
    • Lainz
Re: HTMLtoRGBA
« Reply #2 on: November 03, 2019, 01:46:34 pm »

winni

  • Hero Member
  • *****
  • Posts: 592
Re: HTMLtoRGBA
« Reply #3 on: November 03, 2019, 01:51:47 pm »
Sorry Lainz, but that it accepts HTML numeric strings is not mentioned!
Code: Text  [Select]
  1.  
  2. function StrToBGRA(str: string): TBGRAPixel;
  3.         Converts a fully defined string into a TBGRAPixel value. Color names from VGAColors and CSSColors are used if there is an exact match
  4.  

Winni

lainz

  • Hero Member
  • *****
  • Posts: 3313
    • Lainz
Re: HTMLtoRGBA
« Reply #4 on: November 03, 2019, 03:08:08 pm »
Yes but is documented at least, just needs improvement.

Is easy to fix, since the documentation is in the source code, from where is compiled into the wiki format.
So you can add a pull request in github, or just open an issue with the suggested text it must contain, and it will be fixed =)