Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
d805699a
Commit
d805699a
authored
6 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Use some real colors in colopocalypse
parent
3a80611d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/colopocalypse
+39
-12
39 additions, 12 deletions
bin/colopocalypse
with
39 additions
and
12 deletions
bin/colopocalypse
+
39
−
12
View file @
d805699a
...
...
@@ -10,7 +10,9 @@ const COLOR_REGEX = /(#[a-fA-F0-9]{3}([a-fA-F0-9]{3})?|(rgb|hsl)a?\(\s*\d+\s*(,\
const
COLOR_REGEX_WITH_LINE
=
/
(
#
[
a-fA-F0-9
]{3}([
a-fA-F0-9
]{3})?
|
(
rgb|hsl
)
a
?\(\s
*
\d
+
\s
*
(
,
\s
*
\d
+
(\.\d
+
)?
%
?\s
*
){2,3}\))
.*/g
;
const
FILE_GLOB
=
"
frontend/**/*.{css,js,jsx}
"
;
const
FILE_GLOB_IGNORE
=
[
"
**/metabase/lib/colors.js
"
];
const
FILE_GLOB_IGNORE
=
[
// "**/metabase/lib/colors.js"
];
const
candidates
=
{};
...
...
@@ -27,18 +29,43 @@ function addCandidate(colorName, baseColor, tints = [1]) {
}
// add candidate colors, currently various tints of normal, saturated, and desaturated
const
colors
=
require
(
"
../frontend/src/metabase/lib/colors
"
);
const
tints
=
[
1
,
0.8
,
0.7
,
0.6
,
0.5
,
0.4
,
0.3
,
0.2
,
0.1
,
0.05
,
0.02
];
// const colors = require("../frontend/src/metabase/lib/colors");
// const tints = [1, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.05, 0.02];
//
// for (const [colorName, color] of Object.entries(colors.normal)) {
// addCandidate(colorName, Color(color), tints);
// }
// for (const [colorName, color] of Object.entries(colors.saturated)) {
// addCandidate(colorName + "-saturated", Color(color), tints);
// }
// for (const [colorName, color] of Object.entries(colors.desaturated)) {
// addCandidate(colorName + "-desaturated", Color(color), tints);
// }
for
(
const
[
colorName
,
color
]
of
Object
.
entries
(
colors
.
normal
))
{
addCandidate
(
colorName
,
Color
(
color
),
tints
);
}
for
(
const
[
colorName
,
color
]
of
Object
.
entries
(
colors
.
saturated
))
{
addCandidate
(
colorName
+
"
-saturated
"
,
Color
(
color
),
tints
);
}
for
(
const
[
colorName
,
color
]
of
Object
.
entries
(
colors
.
desaturated
))
{
addCandidate
(
colorName
+
"
-desaturated
"
,
Color
(
color
),
tints
);
}
addCandidate
(
"
brand
"
,
Color
(
"
#509EE3
"
));
addCandidate
(
"
accent1
"
,
Color
(
"
#9CC177
"
));
addCandidate
(
"
accent2
"
,
Color
(
"
#A989C5
"
));
addCandidate
(
"
accent3
"
,
Color
(
"
#EF8C8C
"
));
addCandidate
(
"
accent4
"
,
Color
(
"
#F9D45C
"
));
// addCandidate("accent5", Color("#F1B556"));
// addCandidate("accent6", Color("#A6E7F3"));
// addCandidate("accent7", Color("#7172AD"));
addCandidate
(
"
white
"
,
Color
(
"
#FFFFFF
"
));
addCandidate
(
"
text-dark
"
,
Color
(
"
#2E353B
"
));
addCandidate
(
"
text-medium
"
,
Color
(
"
#93A1AB
"
));
addCandidate
(
"
text-light
"
,
Color
(
"
#DCE1E4
"
));
addCandidate
(
"
bg-dark
"
,
Color
(
"
#EDF2F5
"
));
addCandidate
(
"
bg-light
"
,
Color
(
"
#F9FBFC
"
));
addCandidate
(
"
shadow
"
,
Color
(
"
#F4F5F6
"
));
addCandidate
(
"
border
"
,
Color
(
"
#D7DBDE
"
));
addCandidate
(
"
success
"
,
Color
(
"
#84BB4C
"
));
addCandidate
(
"
error
"
,
Color
(
"
#ED6E6E
"
));
addCandidate
(
"
warning
"
,
Color
(
"
#F9CF48
"
));
// maybe this should weight the difference in hue more heavily?
function
colorDifference
(
colorA
,
colorB
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment