Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
James T. Lee
Dotfiles
Commits
68895298
"lib/puppet/dotfiles/lib/colorscheme.rb" did not exist on "90fff8aca1eb728e6972f658c9120b3ccad93ae3"
Commit
68895298
authored
Jan 05, 2017
by
James T. Lee
Browse files
colorscheme: Try weighting difference by perception indexes
parent
6cfe0237
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lib/ruby/colorscheme.rb
lib/ruby/colorscheme.rb
+2
-2
No files found.
lib/ruby/colorscheme.rb
View file @
68895298
...
@@ -49,9 +49,9 @@ class ColorScheme
...
@@ -49,9 +49,9 @@ class ColorScheme
[
r
,
g
,
b
]
[
r
,
g
,
b
]
end
end
# XXX:
This
do
es
n't t
ake into account human perception
# XXX:
I
don't t
hink this is very accurate, but we'll see
def
-
(
other
)
def
-
(
other
)
Math
.
sqrt
((
r
-
other
.
r
)
**
2
+
(
g
-
other
.
g
)
**
2
+
(
b
-
other
.
b
)
**
2
)
Math
.
sqrt
(
0.2989
*
(
r
-
other
.
r
)
**
2
+
0.5870
*
(
g
-
other
.
g
)
**
2
+
0.1140
*
(
b
-
other
.
b
)
**
2
)
end
end
end
end
...
...
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