Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Canop/coolor
/ functions
Functions
60 in github.com/Canop/coolor
⨍
Functions
60
◇
Types & classes
5
↓ 30 callers
Method
into
(self)
src/color.rs:111
↓ 11 callers
Method
to_ansi
Return the nearest ANSI color This is a slow function as it literally tries all ANSI colors and picks the nearest one.
src/hsl.rs:53
↓ 11 callers
Method
to_rgb
(self)
src/hsl.rs:66
↓ 8 callers
Method
to_hsl
(self)
src/rgb.rs:73
↓ 6 callers
Method
nearest_ansi_in_range
(self, min: u8, max: u8)
src/rgb.rs:23
↓ 5 callers
Function
dist
(a: f32, b: f32)
src/hsl.rs:136
↓ 5 callers
Function
print_ansi
(ansi: AnsiColor)
examples/ansi-mix/main.rs:16
↓ 4 callers
Method
to_hsl
(self)
src/ansi.rs:15
↓ 3 callers
Method
bp
blue part in `[0,1]`
src/rgb.rs:113
↓ 3 callers
Method
distance_to
tentatively perceptual distance between the two colors, except it's just as unscientific it can possibly be so check it looks good before trying ot us
src/hsl.rs:99
↓ 3 callers
Method
gp
green part in `[0,1]`
src/rgb.rs:109
↓ 3 callers
Function
hue_to_rgb_component
(v1: f32, v2: f32, vh: f32)
src/hsl.rs:123
↓ 3 callers
Function
print_color
(ansi: AnsiColor)
examples/ansi-variations/main.rs:8
↓ 3 callers
Function
r255
(v: f32)
src/rgb.rs:140
↓ 3 callers
Method
rp
red part in `[0,1]`
src/rgb.rs:105
↓ 2 callers
Method
distance_to
(self, other: O)
src/rgb.rs:130
↓ 2 callers
Method
hsl
(self)
src/color.rs:22
↓ 2 callers
Method
parts
(self)
src/rgb.rs:116
↓ 2 callers
Function
print_color
(c: Color)
examples/rgb-to-ansi/main.rs:14
↓ 2 callers
Function
rand_ansi
()
examples/ansi-mix/main.rs:12
↓ 1 callers
Method
ansi
(self)
src/color.rs:15
↓ 1 callers
Function
bar
(n: usize)
examples/ansi-mix/main.rs:20
↓ 1 callers
Function
compare
(rgb: Rgb)
examples/rgb-to-ansi/main.rs:19
↓ 1 callers
Method
delta_h
(self, other: Hsl)
src/hsl.rs:87
↓ 1 callers
Method
delta_l
(self, other: Hsl)
src/hsl.rs:93
↓ 1 callers
Method
delta_s
(self, other: Hsl)
src/hsl.rs:90
↓ 1 callers
Function
print_color
(c: Color)
examples/ansi-grey/main.rs:13
↓ 1 callers
Method
rgb
(self)
src/color.rs:29
↓ 1 callers
Function
show
(rgb: Rgb, ansi: AnsiColor)
examples/ansi-grey/main.rs:18
↓ 1 callers
Method
with_luminosity_change
(self, delta_luminosity: f32)
src/ansi.rs:22
↓ 1 callers
Method
with_saturation_change
(self, delta_saturation: f32)
src/ansi.rs:32
Method
blend
compute a natural feeling intermediate between two colors
src/color.rs:40
Function
check_array_lengths
()
src/ansi.rs:2611
Method
checked
Create a new HSL color from its components, checking the ranges
src/hsl.rs:23
Method
from
(ansi: AnsiColor)
src/hsl.rs:113
Method
from
(ansi: AnsiColor)
src/color.rs:62
Method
from
Convert from a (r,g,b) float tupples with components in [0,1[
src/rgb.rs:146
Method
is_grey
(self)
src/rgb.rs:19
Method
luma
(self)
src/color.rs:36
Method
luma
Compute the Luma value characterizing the "light" of the color, going from 0 (black) to 1 (white). Reference: <https://en.wikipedia.org/wiki/Luma_(vi
src/rgb.rs:123
Function
main
()
examples/ansi-grey/main.rs:25
Function
main
()
examples/ansi-variations/main.rs:12
Function
main
()
examples/ansi-mix/main.rs:24
Function
main
()
examples/rgb-to-ansi/main.rs:28
Method
mix
(c1: Self, w1: f32, c2: Self, w2: f32)
src/hsl.rs:30
Method
mix
(c1: Self, w1: f32, c2: Self, w2: f32)
src/rgb.rs:63
Method
near
Tell whether it's about the same color There's no theory behind this function, it should not be used outside of unit tests
src/hsl.rs:107
Method
new
(code: u8)
src/ansi.rs:12
Method
new
Create a new HSL color from its components
src/hsl.rs:16
Method
new
Create a new RGB color from its components
src/rgb.rs:16
Function
test_ansi_to_hsl_to_ansi
()
src/color.rs:137
Function
test_ansi_to_rgb_to_ansi
()
src/color.rs:125
Function
test_hsl_to_rgb_to_hsl
()
src/color.rs:159
Function
test_rgb_to_hsl
()
src/color.rs:148
Method
to_ansi
Return the nearest ANSI color The ansi->rgb->ansi round trip is guaranteed to always fall on the first color.
src/rgb.rs:40
Function
to_hexa
Return the hexa notation commonly used for the web
examples/ansi-grey/main.rs:9
Function
to_hexa
Return the hexa notation commonly used for the web
examples/rgb-to-ansi/main.rs:10
Method
to_rgb
(self)
src/ansi.rs:19
Method
with_luminosity
(self, l: f32)
src/ansi.rs:27
Method
with_saturation
(self, s: f32)
src/ansi.rs:37