# Coloring pointcloud in MeshCat

**URL:** <https://discourse.julialang.org/t/coloring-pointcloud-in-meshcat/16465>\
**Category:** Visualization\
**Tags:** question, colors\
**Created:** [October 17, 2018, 7:54pm UTC](https://discourse.julialang.org/t/coloring-pointcloud-in-meshcat/16465 "2018-10-17T19:54:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cserteGT3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/csertegt3/32/8283_2.png) [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Post date:** [October 17, 2018, 7:54pm UTC](https://discourse.julialang.org/t/coloring-pointcloud-in-meshcat/16465/1 "2018-10-17T19:54:17Z")

</div>

I’m experimenting with MeshCat for my project involving pointclouds and meshes. I wanted to place several pointclouds in the visualizer with different colors. I loaded them from .ply files (only vertices, without faces).  
If I place the mesh with: `setobject!(vis[:hbunny],PointCloud(vertices(half_b)))` it works fine, and has black color. Then I tried with the `Colors.jl` package and the only method that didn’t throw an error was the following: `setobject(vis[:hbunny],PointCloud(vertices(half_b),fill(convert(RGB{Float32},parse(Colorant,"darkred"))),length(vertices(half_b)))))`  
Converting to `Float32` seems compulsory, because if I try the following command:  
`setobject!(vis[:rotbunny],PointCloud(vertices(half_b),fill(parse(Colorant,"darkred"),length(vertices(half_b)))))`  
I get the following error:

```julia
MethodError: no method matching js_array_type(::Type{FixedPointNumbers.Normed{UInt8,8}})
Closest candidates are:
  js_array_type(!Matched::Type{Float32}) at C:\Users\Pista\.julia\packages\MeshCat\rjDJh\src\lowering.jl:115
  js_array_type(!Matched::Type{UInt32}) at C:\Users\Pista\.julia\packages\MeshCat\rjDJh\src\lowering.jl:116

```

I see that `MeshCat` only accepts the `Float32` and `UInt32` types, so my main question is that, is there an easier way to generate the colors for the a pointcloud? (The `Color` package with the `color_names` dictionary would be convenient.)  
And another question came to my mind: is there way to change the size of the points in the `MeshCat` viewer?
