Skip to content

Commit

Permalink
- add API complement for calculating complementary of colors.
Browse files Browse the repository at this point in the history
 - fix typo in README
  • Loading branch information
zbryikt committed Jun 7, 2021
1 parent e33abef commit 18a1ff1
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## v0.0.4

- add API `complement` for calculating complementary of colors.


## v0.0.3

- wrap code by lsc instead of wrapping manually so lsc generated functions can also be wrapped.
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ ldcolor provides following API:
- `int(color)` - convert `color` to 24bit integer.
- `rand()` - randomize and return a color
- `lighter(color, strength)` - make `color` lighter
- `darker(color, strength)` - maerk `color` darker
- `darker(color, strength)` - make `color` darker
- `complement(color)` - get complementary of `color`

These API are also available as a member function in a `ldcolor` object:

Expand Down
9 changes: 9 additions & 0 deletions dist/ldcolor.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,15 @@
a: 1
};
},
complement: function(v){
var rgb;
rgb = utils.rgb(v);
return utils.hsl({
r: 255 - rgb.r,
g: 255 - rgb.g,
b: 255 - rgb.b
});
},
lighter: function(v, k){
var hsl;
v == null && (v = this);
Expand Down
2 changes: 1 addition & 1 deletion dist/ldcolor.min.js

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

9 changes: 9 additions & 0 deletions dist/ldcolor.named.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,15 @@
a: 1
};
},
complement: function(v){
var rgb;
rgb = utils.rgb(v);
return utils.hsl({
r: 255 - rgb.r,
g: 255 - rgb.g,
b: 255 - rgb.b
});
},
lighter: function(v, k){
var hsl;
v == null && (v = this);
Expand Down
Loading

0 comments on commit 18a1ff1

Please sign in to comment.