Skip to content

Commit

Permalink
color fix (#10229)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilDragonfiend authored Dec 1, 2023
1 parent 8eb0f35 commit b9223e8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions code/__DEFINES/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ GLOBAL_LIST_INIT(color_list_blood_brothers, shuffle(list(
"cfc_orange",\
"cfc_redorange")))

// Do not use this as a font color. try cfc color formats.
GLOBAL_LIST_INIT(color_list_rainbow, list(
"#FF5050",\
"#FF902A",\
"#D6B20C",\
"#88d818",\
"#42c9eb",\
"#422ED8",\
"#D977FD"))

// Color Filters
/// Icon filter that creates ambient occlusion
#define AMBIENT_OCCLUSION filter(type="drop_shadow", x=0, y=-2, size=4, color="#04080FAA")
Expand Down
2 changes: 1 addition & 1 deletion code/modules/holoparasite/_holoparasite.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ GLOBAL_LIST_EMPTY_TYPED(holoparasites, /mob/living/simple_animal/hostile/holopar
stack_trace("Holoparasite initialized without a valid theme!")
return INITIALIZE_HINT_QDEL
GLOB.holoparasites += src
set_accent_color(_accent_color || pick(GLOB.color_list_blood_brothers), silent = TRUE)
set_accent_color(_accent_color || pick(GLOB.color_list_rainbow), silent = TRUE)
set_theme(_theme)
if(length(_name))
set_name(_name, internal = TRUE)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/holoparasite/holoparasite_builder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
if(isnum_safe(_uses))
uses = max(round(_uses), 1)
debug_mode = _debug_mode
accent_color = pick(GLOB.color_list_blood_brothers)
accent_color = pick(GLOB.color_list_rainbow)

/datum/holoparasite_builder/Destroy()
QDEL_NULL(saved_stats)
Expand Down Expand Up @@ -195,7 +195,7 @@
var/color = params["color"]
if(!istext(color) || length(color) != 7)
return
var/new_accent_color = sanitize_hexcolor(color, desired_format = 6, include_crunch = TRUE, default = (length(accent_color) == 7 && accent_color != initial(accent_color)) ? accent_color : pick(GLOB.color_list_blood_brothers))
var/new_accent_color = sanitize_hexcolor(color, desired_format = 6, include_crunch = TRUE, default = (length(accent_color) == 7 && accent_color != initial(accent_color)) ? accent_color : pick(GLOB.color_list_rainbow))
if(is_color_dark_with_saturation(new_accent_color, HOLOPARA_MAX_ACCENT_LIGHTNESS))
to_chat(usr, "<span class='warning'>Selected accent color is too dark!</span>")
return
Expand Down
2 changes: 1 addition & 1 deletion code/modules/holoparasite/holoparasite_setters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
if(!new_color)
return FALSE
var/old_accent_color = accent_color
new_color = sanitize_hexcolor(new_color, desired_format = 6, include_crunch = TRUE, default = (length(old_accent_color) == 7 && old_accent_color != initial(accent_color)) ? old_accent_color : pick(GLOB.color_list_blood_brothers))
new_color = sanitize_hexcolor(new_color, desired_format = 6, include_crunch = TRUE, default = (length(old_accent_color) == 7 && old_accent_color != initial(accent_color)) ? old_accent_color : pick(GLOB.color_list_rainbow))
accent_color = new_color
chat_color = new_color
if(tracking_beacon)
Expand Down

0 comments on commit b9223e8

Please sign in to comment.