Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for HEX codes with alpha channel #7

Merged
merged 2 commits into from
Mar 3, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Improve: shorthand hex codes with alpha channel
I've changed color regex to support alpha channels.
  • Loading branch information
kovart committed Feb 24, 2019
commit 3f66a067a77187b8d401da9a1a03014ac26c66fa
108 changes: 54 additions & 54 deletions shorter-css-color-names.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
module.exports = {
aqua: /#00ffff(?!\w)|#00ffffff(?!\w)|#0ff(?!\w)/gi,
azure: /#f0ffff(?!\w)/gi,
beige: /#f5f5dc(?!\w)/gi,
bisque: /#ffe4c4(?!\w)/gi,
black: /#000000(?!\w)|#000000ff(?!\w)|#000(?!\w)/g,
blue: /#0000ff(?!\w)|#0000ffff(?!\w)|#00f(?!\w)/gi,
brown: /#a52a2a(?!\w)/gi,
coral: /#ff7f50(?!\w)/gi,
cornsilk: /#fff8dc(?!\w)/gi,
crimson: /#dc143c(?!\w)/gi,
cyan: /#00ffff(?!\w)|#00ffffff(?!\w)|#0ff(?!\w)/gi,
darkblue: /#00008b(?!\w)/gi,
darkcyan: /#008b8b(?!\w)/gi,
darkgrey: /#a9a9a9(?!\w)/gi,
darkred: /#8b0000(?!\w)/gi,
deeppink: /#ff1493(?!\w)/gi,
dimgrey: /#696969(?!\w)/g,
gold: /#ffd700(?!\w)/gi,
green: /#008000(?!\w)/g,
grey: /#808080(?!\w)/g,
honeydew: /#f0fff0(?!\w)/gi,
hotpink: /#ff69b4(?!\w)/gi,
indigo: /#4b0082(?!\w)/gi,
ivory: /#fffff0(?!\w)/gi,
khaki: /#f0e68c(?!\w)/gi,
lavender: /#e6e6fa(?!\w)/gi,
lime: /#00ff00(?!\w)|#00ff00ff(?!\w)|#0f0(?!\w)/gi,
linen: /#faf0e6(?!\w)/gi,
maroon: /#800000(?!\w)/g,
moccasin: /#ffe4b5(?!\w)/gi,
navy: /#000080(?!\w)/g,
oldlace: /#fdf5e6(?!\w)/gi,
olive: /#808000(?!\w)/g,
orange: /#ffa500(?!\w)/gi,
orchid: /#da70d6(?!\w)/gi,
peru: /#cd853f(?!\w)/gi,
pink: /#ffc0cb(?!\w)/gi,
plum: /#dda0dd(?!\w)/gi,
purple: /#800080(?!\w)/g,
red: /#ff0000(?!\w)|#ff0000ff(?!\w)|#f00(?!\w)/gi,
salmon: /#fa8072(?!\w)/gi,
seagreen: /#2e8b57(?!\w)/gi,
seashell: /#fff5ee(?!\w)/gi,
sienna: /#a0522d(?!\w)/gi,
silver: /#c0c0c0(?!\w)/gi,
skyblue: /#87ceeb(?!\w)/gi,
snow: /#fffafa(?!\w)/gi,
tan: /#d2b48c(?!\w)/gi,
teal: /#008080(?!\w)/g,
thistle: /#d8bfd8(?!\w)/gi,
tomato: /#ff6347(?!\w)/gi,
violet: /#ee82ee(?!\w)/gi,
wheat: /#f5deb3(?!\w)/gi,
white: /#ffffff(?!\w)|#ffffffff(?!\w)|#fff(?!\w)/gi,
aqua: /#00ffff(ff)?(?!\w)|#0ff(f)?(?!\w)/gi,
azure: /#f0ffff(ff)?(?!\w)/gi,
beige: /#f5f5dc(ff)?(?!\w)/gi,
bisque: /#ffe4c4(ff)?(?!\w)/gi,
black: /#000000(ff)?(?!\w)|#000(f)?(?!\w)/gi,
blue: /#0000ff(ff)?(?!\w)|#00f(f)?(?!\w)/gi,
brown: /#a52a2a(ff)?(?!\w)/gi,
coral: /#ff7f50(ff)?(?!\w)/gi,
cornsilk: /#fff8dc(ff)?(?!\w)/gi,
crimson: /#dc143c(ff)?(?!\w)/gi,
cyan: /#00ffff(ff)?(?!\w)|#0ff(f)?(?!\w)/gi,
darkblue: /#00008b(ff)?(?!\w)/gi,
darkcyan: /#008b8b(ff)?(?!\w)/gi,
darkgrey: /#a9a9a9(ff)?(?!\w)/gi,
darkred: /#8b0000(ff)?(?!\w)/gi,
deeppink: /#ff1493(ff)?(?!\w)/gi,
dimgrey: /#696969(ff)?(?!\w)/gi,
gold: /#ffd700(ff)?(?!\w)/gi,
green: /#008000(ff)?(?!\w)/gi,
grey: /#808080(ff)?(?!\w)/gi,
honeydew: /#f0fff0(ff)?(?!\w)/gi,
hotpink: /#ff69b4(ff)?(?!\w)/gi,
indigo: /#4b0082(ff)?(?!\w)/gi,
ivory: /#fffff0(ff)?(?!\w)/gi,
khaki: /#f0e68c(ff)?(?!\w)/gi,
lavender: /#e6e6fa(ff)?(?!\w)/gi,
lime: /#00ff00(ff)?(?!\w)|#0f0(f)?(?!\w)/gi,
linen: /#faf0e6(ff)?(?!\w)/gi,
maroon: /#800000(ff)?(?!\w)/gi,
moccasin: /#ffe4b5(ff)?(?!\w)/gi,
navy: /#000080(ff)?(?!\w)/gi,
oldlace: /#fdf5e6(ff)?(?!\w)/gi,
olive: /#808000(ff)?(?!\w)/gi,
orange: /#ffa500(ff)?(?!\w)/gi,
orchid: /#da70d6(ff)?(?!\w)/gi,
peru: /#cd853f(ff)?(?!\w)/gi,
pink: /#ffc0cb(ff)?(?!\w)/gi,
plum: /#dda0dd(ff)?(?!\w)/gi,
purple: /#800080(ff)?(?!\w)/gi,
red: /#ff0000(ff)?(?!\w)|#f00(f)?(?!\w)/gi,
salmon: /#fa8072(ff)?(?!\w)/gi,
seagreen: /#2e8b57(ff)?(?!\w)/gi,
seashell: /#fff5ee(ff)?(?!\w)/gi,
sienna: /#a0522d(ff)?(?!\w)/gi,
silver: /#c0c0c0(ff)?(?!\w)/gi,
skyblue: /#87ceeb(ff)?(?!\w)/gi,
snow: /#fffafa(ff)?(?!\w)/gi,
tan: /#d2b48c(ff)?(?!\w)/gi,
teal: /#008080(ff)?(?!\w)/gi,
thistle: /#d8bfd8(ff)?(?!\w)/gi,
tomato: /#ff6347(ff)?(?!\w)/gi,
violet: /#ee82ee(ff)?(?!\w)/gi,
wheat: /#f5deb3(ff)?(?!\w)/gi,
white: /#ffffff(ff)?(?!\w)|#fff(f)?(?!\w)/gi,
};