wd wp Пошук:

HSL

HSL, HLS ці HSI (ад англ.: Hue, Saturation, Lightness (Intensity)) — колерная мадэль, у якой колернымі каардынатамі з’яўляюцца тон, насычанасць і светлата. Варта адзначыць, што HSV і HSL — дзве розныя колерныя мадэлі (Lightness — светлата, што адрозніваецца ат яркасці).

Выява, раскладзеная на складнікі H, S і L

Суадносіны з іншымі мадэлямі

Канвертаванне з RGB

H

{

undefined

if 

M A X

M I N

60

×

G − B

M A X − M I N

0

,

if 

M A X

R

and 

G ≥ B

60

×

G − B

M A X − M I N

360

,

if 

M A X

R

and 

G < B

60

×

B − R

M A X − M I N

120

,

if 

M A X

G

60

×

R − G

M A X − M I N

240

,

if 

M A X

B

{\displaystyle H={\begin{cases}{\mbox{undefined}}&{\mbox{if }}MAX=MIN\60^{\circ }\times {\frac {G-B}{MAX-MIN}}+0^{\circ },&{\mbox{if }}MAX=R\&{\mbox{and }}G\geq B\60^{\circ }\times {\frac {G-B}{MAX-MIN}}+360^{\circ },&{\mbox{if }}MAX=R\&{\mbox{and }}G<B\60^{\circ }\times {\frac {B-R}{MAX-MIN}}+120^{\circ },&{\mbox{if }}MAX=G\60^{\circ }\times {\frac {R-G}{MAX-MIN}}+240^{\circ },&{\mbox{if }}MAX=B\end{cases}}}

\{\displaystyle H=\{\begin\{cases\}\{\mbox\{undefined\}\}&\{\mbox\{if \}\}MAX=MIN\\60^\{\circ \}\times \{\frac \{G-B\}\{MAX-MIN\}\}+0^\{\circ \},&\{\mbox\{if \}\}MAX=R\\&\{\mbox\{and \}\}G\geq B\\60^\{\circ \}\times \{\frac \{G-B\}\{MAX-MIN\}\}+360^\{\circ \},&\{\mbox\{if \}\}MAX=R\\&\{\mbox\{and \}\}G<B\\60^\{\circ \}\times \{\frac \{B-R\}\{MAX-MIN\}\}+120^\{\circ \},&\{\mbox\{if \}\}MAX=G\\60^\{\circ \}\times \{\frac \{R-G\}\{MAX-MIN\}\}+240^\{\circ \},&\{\mbox\{if \}\}MAX=B\end\{cases\}\}\},

S

{

0

if 

L

0

 or 

M A X

M I N

M A X − M I N

M A X + M I N

=

M A X − M I N

2 L

,

if 

0 < L ≤

1 2

M A X − M I N

2 − ( M A X + M I N )

=

M A X − M I N

2 − 2 L

,

if 

1 2

< L < 1

{\displaystyle S={\begin{cases}0&{\mbox{if }}L=0{\mbox{ or }}MAX=MIN\{\frac {MAX-MIN}{MAX+MIN}}={\frac {MAX-MIN}{2L}},&{\mbox{if }}0<L\leq {\frac {1}{2}}\{\frac {MAX-MIN}{2-(MAX+MIN)}}={\frac {MAX-MIN}{2-2L}},&{\mbox{if }}{\frac {1}{2}}<L<1\\end{cases}}}

\{\displaystyle S=\{\begin\{cases\}0&\{\mbox\{if \}\}L=0\{\mbox\{ or \}\}MAX=MIN\\\{\frac \{MAX-MIN\}\{MAX+MIN\}\}=\{\frac \{MAX-MIN\}\{2L\}\},&\{\mbox\{if \}\}0<L\leq \{\frac \{1\}\{2\}\}\\\{\frac \{MAX-MIN\}\{2-(MAX+MIN)\}\}=\{\frac \{MAX-MIN\}\{2-2L\}\},&\{\mbox\{if \}\}\{\frac \{1\}\{2\}\}<L<1\\\end\{cases\}\}\}, альбо, у агульным выпадку,

S

M A X − M I N

1 −

|

1 − ( M A X + M I N )

|

{\displaystyle S={\frac {MAX-MIN}{1-|1-(MAX+MIN)|}}}

\{\displaystyle S=\{\frac \{MAX-MIN\}\{1-|1-(MAX+MIN)|\}\}\},

L

1 2

( M A X + M I N )

{\displaystyle L={\begin{matrix}{\frac {1}{2}}\end{matrix}}(MAX+MIN)}

\{\displaystyle L=\{\begin\{matrix\}\{\frac \{1\}\{2\}\}\end\{matrix\}\}(MAX+MIN)\}, дзе:

Канвертаванне ў RGB

Q

{

L × ( 1.0 + S ) ,

if 

L < 0.5

L + S − ( L × S ) ,

if 

L ≥ 0.5

{\displaystyle Q={\begin{cases}L\times (1.0+S),&{\mbox{if }}L<0.5\L+S-(L\times S),&{\mbox{if }}L\geq 0.5\end{cases}}}

\{\displaystyle Q=\{\begin\{cases\}L\times (1.0+S),&\{\mbox\{if \}\}L<0.5\\L+S-(L\times S),&\{\mbox\{if \}\}L\geq 0.5\end\{cases\}\}\}

P

2.0 × L − Q

{\displaystyle P=2.0\times L-Q,}

\{\displaystyle P=2.0\times L-Q\,\}

H

k

=

H 360

{\displaystyle H_{k}={H \over 360},}

\{\displaystyle H_\{k\}=\{H \over 360\}\,\} (прыведзенне ў інтэрвал [0,1])

T

R

=

H

k

1 3

{\displaystyle T_{R}=H_{k}+{\frac {1}{3}},}

\{\displaystyle T_\{R\}=H_\{k\}+\{\frac \{1\}\{3\}\}\,\}

T

G

=

H

k

{\displaystyle T_{G}=H_{k},}

\{\displaystyle T_\{G\}=H_\{k\}\,\}

T

B

=

H

k

1 3

{\displaystyle T_{B}=H_{k}-{\frac {1}{3}},}

\{\displaystyle T_\{B\}=H_\{k\}-\{\frac \{1\}\{3\}\}\,\}

if 

T

c

< 0 →

T

c

=

T

c

1.0

for each

c

R , G , B

{\displaystyle {\mbox{if }}T_{c}<0\rightarrow T_{c}=T_{c}+1.0\quad {\mbox{for each}},c=R,G,B,}

\{\displaystyle \{\mbox\{if \}\}T_\{c\}<0\rightarrow T_\{c\}=T_\{c\}+1.0\quad \{\mbox\{for each\}\}\,c=R,G,B\,\}

if 

T

c

1 →

T

c

=

T

c

− 1.0

for each

c

R , G , B

{\displaystyle {\mbox{if }}T_{c}>1\rightarrow T_{c}=T_{c}-1.0\quad {\mbox{for each}},c=R,G,B,}

\{\displaystyle \{\mbox\{if \}\}T_\{c\}>1\rightarrow T_\{c\}=T_\{c\}-1.0\quad \{\mbox\{for each\}\}\,c=R,G,B\,\}

Для кожнага колера

c

R , G , B

{\displaystyle c=R,G,B}

\{\displaystyle c=R,G,B\}:

c o l o r

c

=

{

P +

(

( Q − P ) × 6.0 ×

T

c

)

,

if 

T

c

<

1 6

Q ,

if 

1 6

T

c

<

1 2

P +

(

( Q − P ) × (

2 3

T

c

) × 6.0

)

,

if 

1 2

T

c

<

2 3

P ,

otherwise 

{\displaystyle \qquad \mathrm {color} _{c}={\begin{cases}P+\left((Q-P)\times 6.0\times T_{c}\right),&{\mbox{if }}T_{c}<{\frac {1}{6}}\Q,&{\mbox{if }}{\frac {1}{6}}\leq T_{c}<{\frac {1}{2}}\P+\left((Q-P)\times ({\frac {2}{3}}-T_{c})\times 6.0\right),&{\mbox{if }}{\frac {1}{2}}\leq T_{c}<{\frac {2}{3}}\P,&{\mbox{otherwise }}\end{cases}}}

\{\displaystyle \qquad \mathrm \{color\} \{c\}=\{\begin\{cases\}P+\left((Q-P)\times 6.0\times T\{c\}\right),&\{\mbox\{if \}\}T_\{c\}<\{\frac \{1\}\{6\}\}\\Q,&\{\mbox\{if \}\}\{\frac \{1\}\{6\}\}\leq T_\{c\}<\{\frac \{1\}\{2\}\}\\P+\left((Q-P)\times (\{\frac \{2\}\{3\}\}-T_\{c\})\times 6.0\right),&\{\mbox\{if \}\}\{\frac \{1\}\{2\}\}\leq T_\{c\}<\{\frac \{2\}\{3\}\}\\P,&\{\mbox\{otherwise \}\}\end\{cases\}\}\}

Тэмы гэтай старонкі (1):
Катэгорыя·Каляровыя прасторы