4

Let's take the powershell command Write-Host "red text" -Fore red this displays "red text" in a foreground of red.
But, you want the text to be displayed in a slightly lighter font color, light red.

Is there a way to do this and get any foreground color (and background) in the RGB spectrum using powershell?

Kudos
  • 346
  • 3
  • 10

2 Answers2

2

See this: https://github.com/PoshCode/Pansies
It is a PowerShell module that does this. There is an issue here related to your question: https://github.com/PowerShell/PowerShell/issues/14588
Please click the above link for more information.

AdamJane23
  • 21
  • 2
1

$PSVersionTable.PSVersion

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7      1      0

(0..256).ForEach{write-host "`e[38;5;$($_)m[$_]"} # background color
(0..256).ForEach{write-host "`e[48;5;$($_)m[$_]"} # Foreground color