Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
coloration
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
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
typescript
coloration
Commits
cce45f15
Commit
cce45f15
authored
May 04, 2020
by
Zéfling
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix alpha calculation for toHEX()
parent
f3346e54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
projects/coloration/src/lib/coloration.ts
projects/coloration/src/lib/coloration.ts
+2
-2
No files found.
projects/coloration/src/lib/coloration.ts
View file @
cce45f15
...
...
@@ -219,7 +219,7 @@ export class Coloration {
toHEX
():
string
{
return
this
.
calcColor
?
this
.
value
<
string
>
(
()
=>
'
#
'
+
(
0x1000000
+
this
.
calcColor
.
intColor
).
toString
(
16
).
slice
(
1
)
+
(
this
.
calcColor
.
alpha
<
1
?
(
0x100
+
Math
.
round
(
this
.
calcColor
.
alpha
*
25
6
)).
toString
(
16
).
slice
(
1
)
:
''
)
+
(
this
.
calcColor
.
alpha
<
1
?
(
0x100
+
Math
.
round
(
this
.
calcColor
.
alpha
*
25
5
)).
toString
(
16
).
slice
(
1
)
:
''
)
)
:
null
;
}
...
...
@@ -283,7 +283,7 @@ export class Coloration {
?
matchHex
[
5
]
:
(
matchHex
[
3
]
?
matchHex
[
3
][
1
]
+
matchHex
[
3
][
1
]
:
undefined
);
intColor
=
parseInt
(
hexaColor
,
16
);
alpha
=
hexaAlpha
!==
undefined
?
parseInt
(
hexaAlpha
,
16
)
/
25
6
:
1
;
alpha
=
hexaAlpha
!==
undefined
?
parseInt
(
hexaAlpha
,
16
)
/
25
5
:
1
;
}
if
(
intColor
===
undefined
)
{
...
...
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