Recent

Author Topic: Colors?  (Read 670 times)

anbadaothcsts@gmail.com

  • New Member
  • *
  • Posts: 18
Colors?
« on: March 28, 2020, 07:09:50 am »
is there any command or procedure i can use to change the color of my text with decimal(or hexadecimal) value?

like if i wanted green i can write:
Code: Pascal  [Select][+][-]
  1.  TextColor(0,255,0)
or
Code: Pascal  [Select][+][-]
  1.  TextColor(65280)
or
Code: Pascal  [Select][+][-]
  1.  TextColor(00FF00)

i'm just asking if pascal can proceed to understand these command?

eljo

  • Sr. Member
  • ****
  • Posts: 408
Re: Colors?
« Reply #1 on: March 28, 2020, 07:12:36 am »
see the function RGBToColor() and friends.

anbadaothcsts@gmail.com

  • New Member
  • *
  • Posts: 18
Re: Colors?
« Reply #2 on: March 28, 2020, 07:39:40 am »
see the function RGBToColor() and friends.
thanks but do i have to include any unit to use the function. If so what's the name of the unit?

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1046
  • Former Delphi 1-7, 10.2 User
Re: Colors?
« Reply #3 on: March 28, 2020, 07:41:24 am »
See the Wiki article on Colors.
o Lazarus v2.1.0 r63871, FPC v3.3.1 r47164, macOS 10.14.6 (with sup update), Xcode 11.3.1
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (VMware Fusion VM)
o FPC 3.0.4, FreeBSD 12.2-STABLE r365646 amd64
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 20.04 (Parallels VM)

anbadaothcsts@gmail.com

  • New Member
  • *
  • Posts: 18
Re: Colors?
« Reply #4 on: March 28, 2020, 08:42:34 am »
See the Wiki article on Colors.
thanks, it really hard to understand these thing especially english is not my mothertounge, but i do see the colors i needed. How do i turn my text into these color
ex: Black, Grey, Silver, White
black and white is doing a good job tho, but i can't change my text to silver nor grey... :-?

jamie

  • Hero Member
  • *****
  • Posts: 3774
Re: Colors?
« Reply #5 on: March 28, 2020, 03:02:36 pm »
looks like you are using the CRT unit ?

anyways...

TextColor($00FF00);

Is bright Green..

 But like I said, you should be or you are using the CRT unit.
The only true wisdom is knowing you know nothing

anbadaothcsts@gmail.com

  • New Member
  • *
  • Posts: 18
Re: Colors?
« Reply #6 on: March 29, 2020, 04:39:11 am »
looks like you are using the CRT unit ?

anyways...

TextColor($00FF00);

Is bright Green..

 But like I said, you should be or you are using the CRT unit.
ohhh i see, tysm<3

 

TinyPortal © 2005-2018