Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Benoit Barbot
GraphEditor
Commits
fc9128bd
Commit
fc9128bd
authored
Oct 15, 2018
by
Benoit Barbot
Browse files
fix color
parent
014557af
Changes
2
Hide whitespace changes
Inline
Side-by-side
TikzEditor/TikzGraph.ml
View file @
fc9128bd
...
...
@@ -89,7 +89,7 @@ let update_state_attr (s,at) attr_id = function
let
get_new_state_attr
(
s
,
at
)
_
=
[
"Attribute"
,
(
fun
(
s
,
at
)
->
(
s
,
at
@
[
""
])
,
B
(
List
.
length
at
))
;
"color"
,
(
fun
(
s
,
at
)
->
(
s
,
at
@
[
"color=black"
])
,
B
(
List
.
length
at
))
;
"fill"
,
(
fun
(
s
,
at
)
->
(
s
,
at
@
[
"fill=black"
])
,
B
(
List
.
length
at
))
;
"fill"
,
(
fun
(
s
,
at
)
->
(
s
,
at
@
[
"fill=black"
])
,
C
(
List
.
length
at
))
;
]
...
...
@@ -183,9 +183,9 @@ let get_new_arc_attr atlist (p1,p2) =
let
print_single_attr
f
a
=
let
open
DrawingGeom
.
Color
in
match
is_prefix
a
"fill="
with
|
Some
x
->
Format
.
fprintf
f
"fill=%s"
(
to_tikz_string
@@
parse
x
)
|
Some
x
->
Format
.
fprintf
f
"fill=
{
%s
}
"
(
to_tikz_string
@@
parse
x
)
|
None
->
(
match
is_prefix
a
"color="
with
|
Some
x
->
Format
.
fprintf
f
"color=%s"
(
to_tikz_string
@@
parse
x
)
|
Some
x
->
Format
.
fprintf
f
"color=
{
%s
}
"
(
to_tikz_string
@@
parse
x
)
|
None
->
Format
.
fprintf
f
"%s"
a
)
...
...
editor/DrawingGeom.ml
View file @
fc9128bd
...
...
@@ -72,7 +72,7 @@ module Color = struct
(
loi
(
g
/
16
))
(
loi
(
g
mod
16
))
(
loi
(
b
/
16
))
(
loi
(
b
mod
16
))
let
to_tikz_string
(
r
,
g
,
b
)
=
Printf
.
sprintf
"rgb,255:red,%i;green,%i;
yellow
,%i"
r
g
b
Printf
.
sprintf
"rgb,255:red,%i;green,%i;
blue
,%i"
r
g
b
end
...
...
Write
Preview
Supports
Markdown
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