123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace TEAMModelOS.Test.PPTX.ColorLibrary
- {
- /// <summary>
- /// 类 名:ColorHSL
- /// 功 能:H 色相 \ S 饱和度(纯度) \ L 亮度 颜色模型
- /// </summary>
- public class ColorHSL
- {
- public ColorHSL(int h, int s, int l)
- {
- this._h = h;
- this._s = s;
- this._l = l;
- }
- private int _h;
- private int _s;
- private int _l;
- /// <summary>
- /// 色相
- /// </summary>
- public int H
- {
- get { return this._h; }
- set
- {
- this._h = value;
- this._h = this._h > 360 ? 360 : this._h;
- this._h = this._h < 0 ? 0 : this._h;
- }
- }
- /// <summary>
- /// 饱和度(纯度)
- /// </summary>
- public int S
- {
- get { return this._s; }
- set
- {
- this._s = value;
- this._s = this._s > 255 ? 255 : this._s;
- this._s = this._s < 0 ? 0 : this._s;
- }
- }
- /// <summary>
- /// 饱和度
- /// </summary>
- public int L
- {
- get { return this._l; }
- set
- {
- this._l = value;
- this._l = this._l > 255 ? 255 : this._l;
- this._l = this._l < 0 ? 0 : this._l;
- }
- }
- }
- }
|