semvec/pypi-packages huggingface dataset:
colorvector 0.0.1
Easily generates a simple linear color array.
Requires Python: >=3.6

# Color Vector

A simple utility that given two colors in RBG format and a number of desired intervals, returns an array of colors
evenly distributed between (and including) the two starting colors.

## How to use it

Import the ```get_palette``` function and feed it your starting and ending colors as arrays of three integers (e.g. [0,0,0] and [255,255,255]) and an integer representing the number of colors you want in the palette (includes the two colors you gave it).

It will return an array of RBG values that fall on the vector between the starting and ending colors that are equidistant from each other (rounded to the nearest integer).

So, if you give it: ```[0,0,0], [255,255,255], 3```
It will return: ```[(0, 0, 0), (128, 128, 128), (255, 255, 255)]```

### How the math works:

```Point 1:  (1,2,3)    Point 2:  (5, 0, -1).  
To lay out the points from Point 1 to Point 2,
Subtract (5,0,-1) - (1,2,3) to get the direction vector for the line.  In this case, <4, -2, -4>.

Then create the parametric equation for the line <x,y,z> = t * <4, -2, -4> + <1,2,3>

This set up leads to: 
when t = 0, <x,y,z> = 0* <4, -2, -4> + <1,2,3>  = < 1,2,3 >
when t = 1, <x,y,z> = 1* <4, -2, -4> + <1,2,3>  = < 5,0,-1 >

To distribute points evenly along this interval, distribute t evenly at the fractional size you need.  
For example for 6 points between and including both Point 1 and Point 2, divide into 5ths by letting 
t=0, .2, .4, .6, .8, 1.  ```
invent-with-python-zh 2022.4.26.0
InventWithPython 中文系列教程
Requires Python: >=3.6

# InventWithPython 中文系列教程

> 原文：[InventWithPython](https://inventwithpython.com/)
> 
> 协议：[CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/)
> 
> 阶段：机翻（1）
> 
> 收割 SB 的人会被 SB 们封神，试图唤醒 SB 的人是 SB 眼中的 SB。——SB 第三定律

* [在线阅读](https://iwpy.apachecn.org)
* [在线阅读（Gitee）](https://apachecn.gitee.io/doc-template/)
* [ApacheCN 学习资源](http://docs.apachecn.org/)

## 贡献指南

本项目需要校对，欢迎大家提交 Pull Request。

> 请您勇敢地去翻译和改进翻译。虽然我们追求卓越，但我们并不要求您做到十全十美，因此请不要担心因为翻译上犯错——在大部分情况下，我们的服务器已经记录所有的翻译，因此您不必担心会因为您的失误遭到无法挽回的破坏。（改编自维基百科）

## 联系方式

### 负责人

* [飞龙](https://github.com/wizardforcel): 562826179

### 其他

*   在我们的 [apachecn/invent-with-python-zh](https://github.com/apachecn/invent-with-python-zh) github 上提 issue.
*   发邮件到 Email: `apachecn@163.com`.
*   在我们的 [组织学习交流群](https://www.apachecn.org/#/docs/join) 中联系群主/管理员即可.

## 下载

### Docker

```
docker pull apachecn0/invent-with-python-zh
docker run -tid -p <port>:80 apachecn0/invent-with-python-zh
# 访问 http://localhost:{port} 查看文档
```

### PYPI

```
pip install invent-with-python-zh
invent-with-python-zh <port>
# 访问 http://localhost:{port} 查看文档
```

### NPM

```
npm install -g invent-with-python-zh
invent-with-python-zh <port>
# 访问 http://localhost:{port} 查看文档
```

## 其它协议

霞鹜文楷采用 [SIL 开放字体协议 1.1](https://github.com/lxgw/LxgwWenKai/blob/main/SIL_Open_Font_License_1.1.txt)。

## 赞助我们

![](http://data.apachecn.org/img/about/donate.jpg)