# Newbie cv2 4.1.1 Python - how to get Scalar color?

**URL:** https://forum.opencv.org/t/newbie-cv2-4-1-1-python-how-to-get-scalar-color/3796
**Category:** Python
**Created:** [June 11, 2021, 7:31pm UTC](https://forum.opencv.org/t/newbie-cv2-4-1-1-python-how-to-get-scalar-color/3796 "2021-06-11T19:31:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bradrover](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@bradrover](https://forum.opencv.org/u/bradrover)
#### Post date: [June 11, 2021, 7:31pm UTC](https://forum.opencv.org/t/newbie-cv2-4-1-1-python-how-to-get-scalar-color/3796/1 "2021-06-11T19:31:29Z")

</div>

I’m trying to draw a rectangle on an image using a tuple for color, which is what I see in all of the examples (0, 255, 0). The error I get says TypeError: an integer is required (got type tuple). I can draw a line just fine with a tuple for color, so I’m confused.

```auto
def annotateImage(cudaImage, detections):
    # cv2
    array = jetson.utils.cudaToNumpy(cudaImage)
    cv2.cvtColor(array, cv2.COLOR_RGB2BGR)
    color = (0, 255, 0)
    thickness = 2
    for detection in detections:
      topLeft = (detection.Left, detection.Top)
      bottomRight = (detection.Right, detection.Bottom)
      cv2.rectangle(array, topLeft, bottomRight, color, thickness)
    cv2.cvtColor(array, cv2.COLOR_BGR2RGB)
    return jetson.utils.cudaFromNumpy(array)

```

Thanks for any help.

---

<div class="post-metadata">

### Author: ![bradrover](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@bradrover](https://forum.opencv.org/u/bradrover)
#### Post date: [June 11, 2021, 7:55pm UTC](https://forum.opencv.org/t/newbie-cv2-4-1-1-python-how-to-get-scalar-color/3796/2 "2021-06-11T19:55:11Z")

</div>

Looks like I was way off base. I needed to cast the coordinates to int.
