How to have multiple colors in a Windows batch file?

You can do multicolor outputs without any external programs. @echo off SETLOCAL EnableDelayedExpansion for /F “tokens=1,2 delims=#” %%a in (‘”prompt #$H#$E# & echo on & for %%b in (1) do rem”‘) do ( set “DEL=%%a” ) echo say the name of the colors, don’t read call :ColorText 0a “blue” call :ColorText 0C “green” call :ColorText … Read more

How to get hex color value rather than RGB value?

TLDR Use this clean one-line function with both rgb and rgba support: const rgba2hex = (rgba) => `#${rgba.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+\.{0,1}\d*))?\)$/).slice(1).map((n, i) => (i === 3 ? Math.round(parseFloat(n) * 255) : parseFloat(n)).toString(16).padStart(2, ‘0’).replace(‘NaN’, ”)).join(”)}` 2021 updated answer Much time has passed since I originally answered this question. Then cool ECMAScript 5 and 2015+ features become largely available on … Read more

How to read with JavaScript [closed]

you can use id to get the element you want to style. <!DOCTYPE html> <html> <body> <p id=”myp”>Click the button to change the style of the p element.</p> <button onclick=”myFunction()”>Try it</button> <script> function myFunction() { var color1 = Math.floor((Math.random() * 255) + 1); var color2 = Math.floor((Math.random() * 255) + 1); var color3 = Math.floor((Math.random() … Read more