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

Already on GitHub? Sign in to your account

Error running color function on Javascript evaluation #42

Closed
mindfullsilence opened this Issue Nov 3, 2012 · 3 comments

Comments

Projects
None yet
3 participants

The first 2 lines below works exactly as it should. But using a color function against it throws an error and fails compilation. This is using the node.js precompiler, not the browser processor version.

@start: `'#' + Math.floor(Math.random() * 16777215).toString(16)`;
@color: ~`@{start}`;

.randomColor {
    color: lighten(@color, 20%);
}

errors thrown:

undefined_methodError: error evaluating function `lighten`: Object #<Object> has no method 'toHSL' in /Applications/MAMP/htdocs/CFJ/static/less/randomColor.less:8:8
7 .randomColor {
8   color: lighten(@color, 50%);
Owner

lukeapage commented Dec 6, 2012

Hi, this is a less.js bug... we are trying to suggest people don't use javascript if they can help it..

maybe you could instead add support for this change...

cloudhead/less.js#732

I'm having the same error on ubuntu while others trying to compile the same file on OSX are fine.

lessc -v
lessc 1.3.0 (LESS Compiler) [JavaScript]

node -v
v0.6.12

same problem with node v0.8.16

Owner

lukeapage commented Jan 1, 2013

what you have written will never work. use the color function to convert to a color, e.g.

 @color: color(~`@{start}`);

@lukeapage lukeapage closed this Jan 1, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment