# Weird colorbar

**URL:** <https://discourse.julialang.org/t/weird-colorbar/25670>\
**Category:** General Usage\
**Tags:** question, array, colors\
**Created:** [June 25, 2019, 10:56pm UTC](https://discourse.julialang.org/t/weird-colorbar/25670 "2019-06-25T22:56:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wiktorkujawa](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@wiktorkujawa](https://discourse.julialang.org/u/wiktorkujawa)\
**Post date:** [June 25, 2019, 10:56pm UTC](https://discourse.julialang.org/t/weird-colorbar/25670/1 "2019-06-25T22:56:14Z")

</div>

I generated some plots and wanted to add colorbar to them and it partially works.  
 ![weirdBar](https://global.discourse-cdn.com/julialang/original/3X/f/d/fd0d2607d9725dfe17763d682376b6ca667a9926.png)  
My code to generate this bar in CImGui is:

```julia
low=colorant"navyblue";
medium=colorant"limegreen";
high=colorant"yellow";
barImage=Array{RGB{Normed{UInt8,8}}}(undef,1,3)

barImage[1]=high
barImage[2]=medium
barImage[3]=low

barImage=unsafe_wrap(Array{UInt8,3}, convert(Ptr{UInt8}, pointer(barImage)), (Cint(3), Cint(1), Cint(3)))
ImGui_ImplOpenGL3_ReplaceStrechedImageTexture(color_bar_id, barImage, 1, 3; format = GL_RGB)

```

Where ReplaceStrechedImageTexture is my own added function(however the problem shouldn’t be caused by this):

```julia
function ImGui_ImplOpenGL3_ReplaceStrechedImageTexture(id, image_data, image_width, image_height; format=GL_RGBA, type=GL_UNSIGNED_BYTE)
    global g_ImageTexture
    glBindTexture(GL_TEXTURE_2D, g_ImageTexture[id])
    glTexImage2D(GL_TEXTURE_2D, 0, format, GLsizei(image_width), GLsizei(image_height), 0, format, type, image_data)
end

```

The problem is with lower part of colorbar.  
 ![weirdBar](https://global.discourse-cdn.com/julialang/original/3X/0/d/0d292ccb778f3f0bebd568576a2845bd645a04de.png)  
From my point of view and with image analysis, this “navyblue” color should be the lower part(I don’t know from this white/grey part on the bottom has been generated), because the lower values occur on the second and fourth quarter of plot.
