# HSL 210 hue should be in blue but rendering green

**URL:** https://discourse.processing.org/t/hsl-210-hue-should-be-in-blue-but-rendering-green/44788
**Category:** Coding Questions
**Created:** [July 20, 2024, 10:25pm UTC](https://discourse.processing.org/t/hsl-210-hue-should-be-in-blue-but-rendering-green/44788 "2024-07-20T22:25:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Leo\_Aguiar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/leo_aguiar/32/18942_2.png) [@Leo\_Aguiar](https://discourse.processing.org/u/Leo_Aguiar)
#### Post date: [July 20, 2024, 10:25pm UTC](https://discourse.processing.org/t/hsl-210-hue-should-be-in-blue-but-rendering-green/44788/1 "2024-07-20T22:25:11Z")

</div>

Hi I’m making a plot of different colors on a 2d mapping of hsl color space. I think I have something wrong. The hue value of 210 should give a blue color but what is being drawn is green.

```auto
let dim = 100;
let mult = 5;

function setup() {
  createCanvas(dim*mult, dim*mult);

  // Use HSL color with values in the range 0-100.
  colorMode(HSL, dim*mult);

  for (let x = 0; x < dim*mult; x += 1) {
    for (let y = 0; y < dim*mult; y += 1) {
      stroke(210, x, y);
      point(x, y);
    }
  }

//first point plotted
  stroke(0,0,0);
  strokeWeight(20);
  point(0,100*mult);
  
  stroke(0,0,100*mult);
  strokeWeight(15);
  point(0,100*mult);
}

```

Thanks for the help.

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [July 20, 2024, 11:49pm UTC](https://discourse.processing.org/t/hsl-210-hue-should-be-in-blue-but-rendering-green/44788/2 "2024-07-20T23:49:48Z")

</div>

> [@Leo\_Aguiar](#):
>
> The hue value of 210 should give a blue color but what is being drawn is green.

240 is blue for HSL (0 to 360).

Try this to scale the blue to your colorMode scale 0 to 500:  
240/360\*500

References:

- [Guide to Blue | PicMonkey Guide to Color](https://www.picmonkey.com/colors/blue)
- [colorMode](https://p5js.org/reference/p5/colorMode/)

`:)`
