Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
21_22-J-02
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
21_22-J-02
21_22-J-02
Commits
70e6c083
Commit
70e6c083
authored
Apr 19, 2022
by
NaweenTharuka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Colour cube checker
parent
aba38311
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
165 additions
and
1 deletion
+165
-1
Presently/presently/users/templates/users/colourcube.html
Presently/presently/users/templates/users/colourcube.html
+164
-0
Presently/presently/users/templates/users/profile.html
Presently/presently/users/templates/users/profile.html
+1
-1
No files found.
Presently/presently/users/templates/users/colourcube.html
0 → 100644
View file @
70e6c083
{% extends 'users/base.html' %}
{% load static %}
{% block content %}
<link
rel=
"stylesheet"
href=
"{% static 'users/assets/css/main.css' %}"
type=
"text/css"
>
<main
class=
"l__main p__main container"
>
<article
class=
"l__max u__space__outer"
>
<form
action=
"/"
class=
"u__space__outer u__space__vertical cc__form"
method=
"post"
>
<div
class=
"g__row"
>
<div
class=
"g__col g--three rhythm"
>
<h2>
Step 1:
</h2>
<p>
Detect HEX colors from the input image.
</p>
<!--Here is where the user uploads-->
<div>
Upload as many images as you would like.
</div>
<br>
<input
type=
"file"
id=
"files"
name=
"files[]"
multiple
/>
<br>
<output
id=
"list"
></output>
<!--This script has to be called after the file input is initialized-->
<script>
document
.
getElementById
(
'
files
'
).
addEventListener
(
'
change
'
,
handleFileSelect
,
false
);
</script>
<!--This is where the image will technically go when we're taking color information from it (standard HTML5)-->
<canvas
id=
"canvas"
style=
"display: none;"
width=
"150"
height=
"150"
></canvas>
<!--This is where the colors will show up-->
<div
id=
"theme"
>
<p
id=
"message"
></p>
<!--Something curious about this is if you keep clicking on the image,
you'll get the same colors, but sometimes in a different order.-->
<div
id=
"pickedColor"
class=
"colorResults"
></div>
<div
id=
"color1"
class=
"colorResults"
></div>
<div
id=
"color2"
class=
"colorResults"
></div>
<div
id=
"color3"
class=
"colorResults"
></div>
</div>
<br>
<br>
<div
id=
"scheme"
>
<br>
<br>
<br>
<br>
<p>
Generated Mono Color Scheme
</p>
<div
class=
"swatches"
>
<div
class=
"swatch"
id=
"s0"
></div>
<div
class=
"swatch"
id=
"s1"
></div>
<div
class=
"swatch"
id=
"s2"
></div>
<div
class=
"swatch"
id=
"s3"
></div>
<div
class=
"swatch"
id=
"s4"
></div>
<div
class=
"swatch"
id=
"s5"
></div>
<div
class=
"swatch"
id=
"s6"
></div>
<div
class=
"swatch"
id=
"s7"
></div>
<div
class=
"swatch"
id=
"s8"
></div>
<div
class=
"swatch"
id=
"s9"
></div>
<input
type=
"text"
id=
"ts3"
class=
"inputField"
>
<input
type=
"text"
id=
"ts0"
class=
"inputField"
>
<input
type=
"text"
id=
"ts1"
class=
"inputField"
>
<input
type=
"text"
id=
"ts2"
class=
"inputField"
>
<textarea
style=
"display: none;"
name=
""
id=
"txtArea"
cols=
"10"
rows=
"5"
></textarea>
</div>
</div>
<div>
<div
class=
"g__col g--three"
>
<div
class=
"cc__form__row"
>
<label
class=
"cc__form__label"
for=
"white-value"
>
Light
</label>
<input
class=
"cc__form__input"
type=
"text"
id=
"white-value"
name=
"white-value"
value=
"#FFFFFF"
required
/>
</div>
<div
class=
"cc__form__row"
>
<label
class=
"cc__form__label"
for=
"black-value"
>
Dark
</label>
<input
class=
"cc__form__input"
type=
"text"
id=
"black-value"
name=
"black-value"
value=
"#101010"
required
/>
</div>
</div>
</div>
<!-- Submit Button -->
<div
class=
"cc__form__submit g--wide text-align-center"
>
<input
id=
"brand-color-button"
name=
"brand-color-button"
type=
"submit"
class=
"cc__form__button"
value=
"Get Ratios"
>
</div>
</div>
</form>
<div
id=
"results-content"
class=
"u__space__vertical--bottom cc__results"
>
<div
class=
"u__space__outer cc__results__description"
>
<h2
class=
"cc__results__title u__space__vertical--bottom"
>
Step 2: Review colors!
</h2>
<div
class=
"g__row"
>
<div
class=
"g__col g--two rhythm"
>
<h3>
Criteria
</h3>
<p>
This tool shows three different ratio targets and how your color performs with each — white,
black, or other colors in your palette:
</p>
<ul>
<li><strong
class=
"text-light"
>
WCAG Level AAA:
</strong>
a contrast ratio equal or greater
than
<strong>
7.0
</strong>
. For large-scale text, a ratio equal or greater than
<strong>
4.5
</strong>
.
</li>
<li><strong
class=
"text-light"
>
WCAG Level AA:
</strong>
a contrast ratio equal or greater
than
<strong>
4.5
</strong>
. For large-scale text, a ratio equal or greater than
<strong>
3.0
</strong>
.
</li>
<li>
Text that is considered “Large-scale” is
<strong>
18 points (24px)
</strong>
or larger or
<strong>
14 points (19px) and bold
</strong>
or larger.
</li>
</ul>
</div>
<div
class=
"g__col g--two rhythm"
>
<p>
For more details about success criteria, see the
<a
title=
"Go to w3 website in a new window"
target=
"_blank"
href=
"https://www.w3.org/TR/WCAG21/#contrast-minimum"
>
WCAG 2.1 minimum
contrast ratios
</a>
page.
</p>
<h3>
Modify with HSL
</h3>
<p><strong>
Why HSL?
</strong>
By modifying primarily the saturation and/or lightness, the
original intention of the color is intact. To modify the Hue would be to start to modify the
color from a blue to a blue-green, or from a red to an orange. Of course, modify the Hue as
you wish as well, but our intention is to show how small movements to the saturation and
lightness can increase accessibility while retaining the intention of the brand color.
<a
href=
"https://www.nixsensor.com/what-is-hsl-color/"
target=
"_blank"
>
More about how HSL
works
</a>
.
</p>
</div>
</div>
</div>
<div
id=
"results-output"
class=
"u__space__vertical--top cc__results__content"
></div>
<div
class=
"l__max--text u__space__outer u__space__vertical--top rhythm cc__results__description"
>
<h3>
Edge values
</h3>
<p>
Be careful with
<strong
class=
"text-light"
>
EDGE
</strong>
values
—
the color passes validation,
but is within 0.5. It may still present a legibility issue even though it gets a passing grade.
</p>
<h3>
Most legible Pair
</h3>
<p>
From the given list of colors, which color combination is the
<em>
most legible
</em>
? This does not
mean that the color pair will pass minimum requirements, but it has the best chance of passing.
</p>
<p><strong
class=
"text-light"
>
Custom:
</strong>
Use the text input to change the color pairing.
</p>
<h3>
Check your hover text color vs. your body text color
</h3>
<p>
If
<a
title=
"Go to Webaim.org, link opens in a new window."
target=
"_blank"
href=
"http://webaim.org/techniques/hypertext/link_text#appearance"
>
links are not underlined
</a>
,
there must be 3:1 contrast between link text and body text and also an additional change (e.g.,
underlining) on mouse hover and keyboard focus. Use the tool to compare your link color against your
body text color to see how they pair in the Most Legible column.
</p>
</div>
</div>
</article>
</main>
{% endblock content %}
\ No newline at end of file
Presently/presently/users/templates/users/profile.html
View file @
70e6c083
...
...
@@ -19,7 +19,7 @@
<h3><b>
Email
</b>
: {{user.email}}
</h3>
<div
class=
"my-5"
>
<a
class=
"btn btn-info"
href=
"{% url 'feedback' %}"
type=
"submit"
>
Watch your Uploaded Videos
</a>
<
a
class=
"btn btn-info"
href=
"{% url 'test' %}"
type=
"submit"
>
TEST
</a
>
<
!-- <a class="btn btn-info" href="{% url 'test' %}" type="submit">TEST</a> --
>
</div>
</div>
</div>
...
...
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