Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- pip
- SSH
- ubuntu
- label
- Python
- pandas
- 채보
- C
- error
- Linux
- C#
- C++
- Visual Studio
- OpenCV
- 기타 연주
- mysql
- LIST
- windows forms
- Numpy
- pytorch
- paramiko
- 컨테이너
- JSON
- Docker
- 핑거스타일
- Selenium
- VS Code
- 오류
- YOLO
- 프로그래머스
Archives
- Today
- Total
목록색상 팔레트 (1)
기계는 거짓말하지 않는다
Python colorsys 모듈을 이용한 일정한 분포의 색상 생성 함수
Python에서 colorsys 모듈을 이용하여 지정된 개수만큼의 색상을일정하게 분포된 색상 팔레트를 생성하는 간단한 함수이다.import colorsysdef generate_colors(num_classes: int, alpha=1): """ list of tuple: (R, G, B, A) 0~255 """ colors = [] for i in range(num_classes): hue = i / num_classes # S=1.0, V=1.0 rgb = colorsys.hsv_to_rgb(hue, 1.0, 1.0) # # RGB 0~255 # r, g, b = [int(x * 255) for x in ..
Python
2025. 1. 21. 22:47