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

fromHex fix #4

Merged
merged 2 commits into from
Nov 3, 2017
Merged
Show file tree
Hide file tree
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
feat: Fix fromHex for short hex form
  • Loading branch information
kijowski committed Nov 2, 2017
commit 33d7165d9b3a7e09cea538439919c2df1efb8e25
2 changes: 1 addition & 1 deletion dist/files/Color.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class Color extends Pt {

if (hex[0] == "#") hex = hex.substr(1); // remove '#' if needed
if (hex.length <= 3) {
let fn = (i) => hex[1]||"F";
let fn = (i) => hex[i]||"F";
hex = `${fn(0)}${fn(0)}${fn(1)}${fn(1)}${fn(2)}${fn(2)}`;
}

Expand Down