Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
楚学文
node-sass
Commits
48a19d0a
Commit
48a19d0a
authored
Sep 06, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding error checking for hue, saturation, and lightness.
parent
c87719a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
functions.cpp
functions.cpp
+3
-0
No files found.
functions.cpp
View file @
48a19d0a
...
...
@@ -255,6 +255,7 @@ namespace Sass {
extern
Signature
hue_sig
=
"hue($color)"
;
Node
hue
(
const
Node
parameter_names
,
Environment
&
bindings
,
Node_Factory
&
new_Node
)
{
Node
rgb_color
(
bindings
[
parameter_names
[
0
].
token
()]);
if
(
rgb_color
.
type
()
!=
Node
::
numeric_color
)
throw_eval_error
(
"argument to 'hue' must be a color"
,
rgb_color
.
path
(),
rgb_color
.
line
());
Node
hsl_color
(
rgb_to_hsl
(
rgb_color
[
0
].
numeric_value
(),
rgb_color
[
1
].
numeric_value
(),
rgb_color
[
2
].
numeric_value
(),
...
...
@@ -265,6 +266,7 @@ namespace Sass {
extern
Signature
saturation_sig
=
"saturation($color)"
;
Node
saturation
(
const
Node
parameter_names
,
Environment
&
bindings
,
Node_Factory
&
new_Node
)
{
Node
rgb_color
(
bindings
[
parameter_names
[
0
].
token
()]);
if
(
rgb_color
.
type
()
!=
Node
::
numeric_color
)
throw_eval_error
(
"argument to 'saturation' must be a color"
,
rgb_color
.
path
(),
rgb_color
.
line
());
Node
hsl_color
(
rgb_to_hsl
(
rgb_color
[
0
].
numeric_value
(),
rgb_color
[
1
].
numeric_value
(),
rgb_color
[
2
].
numeric_value
(),
...
...
@@ -275,6 +277,7 @@ namespace Sass {
extern
Signature
lightness_sig
=
"lightness($color)"
;
Node
lightness
(
const
Node
parameter_names
,
Environment
&
bindings
,
Node_Factory
&
new_Node
)
{
Node
rgb_color
(
bindings
[
parameter_names
[
0
].
token
()]);
if
(
rgb_color
.
type
()
!=
Node
::
numeric_color
)
throw_eval_error
(
"argument to 'lightness' must be a color"
,
rgb_color
.
path
(),
rgb_color
.
line
());
Node
hsl_color
(
rgb_to_hsl
(
rgb_color
[
0
].
numeric_value
(),
rgb_color
[
1
].
numeric_value
(),
rgb_color
[
2
].
numeric_value
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment