This article mainly introduces the conversion between the hexadecimal color value (HEX) and the RGB format in javascript, and uses the regular method to convert the RGB color to the hexadecimal color, you can refer to the conversion between
In daily development, values in different formats are often converted to each other. The following provides a solution.
Copy codeThe Code is as follows:// Regular Expression of hexadecimal color valueVar reg =/^ # ([0-9a-fA-f] {3} | [0-9a-fA-f] {6})
Prologue
I saw a good foreign Article, Making annoying rainbows in javascript. in fact, I really wanted to translate it, but it was really difficult for a person who hadn't even passed cet6, some paragraphs seem to understand the meaning, but do not
Go to a fixed-length hexadecimal string. If it is not enough, add 0javascript to find a value for the background color, so you have to parse it yourself.
The Code is as follows:
// Convert to a fixed-length hexadecimal string. If not, add
RGB value conversion
Rbg is often used for image processing. It can be expressed in decimal (0-255) or hexadecimal (00-ff. A pound is equal to or equal to a hexadecimal value.The decimal number is represented by 0 to 9 digits. The
Copy Code code as follows:
Go to a fixed-length hexadecimal string, not enough to fill 0
function Zero_fill_hex (num, digits) {
var s = num.tostring (16);
while (S.length s = "0" + s;
return s;
}
Damn it, how did you find out how to
1Do not think that struts is out of date, or blindly follow JSF and the updated MVC framework.Is the best MVC Framework, especially later in combination with spring, Hibernate (or ibatis), so that the struts application has been further developed.
13, Color
1. Background color (Background color)
Q: How to modify the background color of the page.
A: You can change the background color by setting the Document.bgcolor property. For example, change the background color to gray:
Document.bgcolor=
Your website is running properly. Now let's make it run faster. The website performance is determined by the page loading speed and code execution efficiency. Some services can make your website load faster, such as compression and CDN, but make
Original Author: Andy CroxallOriginal link: Ten oddities and secrets about JavaScriptTranslation Editor: Rok Zhang Xinsen XuData types and Definitions1. Null is an objectJavaScript has a null type in many types, it has a unique value of NULL, that
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.