Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Crunch
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
Crunch
Commits
f3ec0a18
Verified
Commit
f3ec0a18
authored
2 years ago
by
Louis
Browse files
Options
Downloads
Patches
Plain Diff
Fix missing characters in text format palette
parent
c1148076
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/commands/palette.rs
+5
-3
5 additions, 3 deletions
src/commands/palette.rs
src/utils.rs
+2
-2
2 additions, 2 deletions
src/utils.rs
with
7 additions
and
5 deletions
src/commands/palette.rs
+
5
−
3
View file @
f3ec0a18
...
...
@@ -21,9 +21,11 @@ pub fn sort_by_hue(palette: &mut PixelPalette) {
let
hue_a
=
pa
.hue
();
let
hue_b
=
pb
.hue
();
println!
(
"A: {} vs B: {}"
,
hue_a
,
hue_b
);
if
hue_a
>
hue_b
{
if
hue_a
.is_nan
()
&&
hue_b
.is_nan
()
{
Ordering
::
Equal
}
else
if
hue_a
.is_nan
()
{
Ordering
::
Less
}
else
if
hue_b
.is_nan
()
||
hue_a
>
hue_b
{
Ordering
::
Greater
}
else
if
hue_b
>
hue_a
{
Ordering
::
Less
...
...
This diff is collapsed.
Click to expand it.
src/utils.rs
+
2
−
2
View file @
f3ec0a18
...
...
@@ -232,7 +232,7 @@ impl From<BasicLab> for Vec3 {
impl
UpperHex
for
BasicRgba
{
fn
fmt
(
&
self
,
f
:
&
mut
Formatter
<
'_
>
)
->
std
::
fmt
::
Result
{
f
.write_str
(
&
format!
(
"{:2X}{:2X}{:2X}{:2X}"
,
"{:
0
2X}{:
0
2X}{:
0
2X}{:
0
2X}"
,
self
.r
,
self
.g
,
self
.b
,
self
.a
))
}
...
...
@@ -240,7 +240,7 @@ impl UpperHex for BasicRgba {
impl
LowerHex
for
BasicRgba
{
fn
fmt
(
&
self
,
f
:
&
mut
Formatter
<
'_
>
)
->
std
::
fmt
::
Result
{
f
.write_str
(
&
format!
(
"{:2x}{:2x}{:2x}{:2x}"
,
"{:
0
2x}{:
0
2x}{:
0
2x}{:
0
2x}"
,
self
.r
,
self
.g
,
self
.b
,
self
.a
))
}
...
...
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